Class: Unidom::Score::ScoreItem

Inherits:
ApplicationRecord show all
Includes:
Common::Concerns::ModelExtension
Defined in:
app/models/unidom/score/score_item.rb

Overview

Score Item 是评分项。 #sheet 是评分表。 #template 是评分项模版。 #scorer 是评分者。

Class Method Summary collapse

Class Method Details

.score!(sheet: nil, scorer: sheet.try(:scorer), template: nil, title: template.try(:title), score: 0, scored_on: Date.current, opened_at: Time.now, description: nil, instruction: nil) ⇒ Object



29
30
31
# File 'app/models/unidom/score/score_item.rb', line 29

def self.score!(sheet: nil, scorer: sheet.try(:scorer), template: nil, title: template.try(:title), score: 0, scored_on: Date.current, opened_at: Time.now, description: nil, instruction: nil)
  create! sheet: sheet, scorer: scorer, template: template, title: title, score: score, scored_on: scored_on, opened_at: opened_at, description: description, instruction: instruction
end