<commit_before># Score Sheet Tempalte 是评分表模版。
# #template 是评分表模版。
# #scorer 是评分者。
# #score_keeper 是得分者。

class Unidom::Score::ScoreSheetTemplate < Unidom::Score::ApplicationRecord

  self.table_name = 'unidom_score_sheet_templates'

  include Unidom::Common::Concerns::ModelExtension

  validates :name,        allow_blank: true, length: { in: 2..columns_hash['name'].limit }
  validates :total_score, presence:    true, numericality: { greater_than_or_equal_to: 0, less_than_or_equal_to: 1_000_000_000 }

  belongs_to :subject, polymorphic: true

  has_many :sheets, class_name: 'Unidom::Score::ScoreSheet'

  scope :subject_is, ->(subject) { where subject: subject }

end<commit_msg>1, Improve the Score Sheet Template model to add the association to the Score Item Template model. 2, Improve the Score Sheet Template model for the comments.<commit_after># Score Sheet Tempalte 是评分表模版。
# #subject 是主题。
# #items 是评分项模版。
# #scorings 是评分表。

class Unidom::Score::ScoreSheetTemplate < Unidom::Score::ApplicationRecord

  self.table_name = 'unidom_score_sheet_templates'

  include Unidom::Common::Concerns::ModelExtension

  validates :name,        allow_blank: true, length: { in: 2..columns_hash['name'].limit }
  validates :total_score, presence:    true, numericality: { greater_than_or_equal_to: 0, less_than_or_equal_to: 1_000_000_000 }

  belongs_to :subject, polymorphic: true

  has_many :items,    class_name: 'Unidom::Score::ScoreItemTemplate', foreign_key: :sheet_id
  has_many :scorings, class_name: 'Unidom::Score::ScoreSheet',        foreign_key: :template_id

  scope :subject_is, ->(subject) { where subject: subject }

end
{'fraction_non_alphanumeric': 0.10812461820403177, 'fraction_numerical': 0.01588271227855834, 'mean_word_length': 5.796680497925311, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3740862', 'n_tokens_mistral': 603, 'n_tokens_neox': 571, 'n_words': 131}