Class: Unidom::Score::ScoreSheet

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

Overview

Score Sheet 是评分表。 #template 是评分表模版。 #scorer 是评分者。 #score_keeper 是得分者。 #items 是评分项。

Class Method Summary collapse

Class Method Details

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



32
33
34
# File 'app/models/unidom/score/score_sheet.rb', line 32

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