summaryrefslogtreecommitdiff
path: root/app/models/scoring_criterium.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/scoring_criterium.rb')
-rw-r--r--app/models/scoring_criterium.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/models/scoring_criterium.rb b/app/models/scoring_criterium.rb
new file mode 100644
index 0000000..a94ad77
--- /dev/null
+++ b/app/models/scoring_criterium.rb
@@ -0,0 +1,9 @@
+class ScoringCriterium < ApplicationRecord
+ has_many :scores, dependent: :destroy
+
+ validates :name, :category, presence: true
+
+ def self.grouped_by_category
+ ScoringCriterium.all.group_by(&:category)
+ end
+end
Copyright 2019--2025 Marius PETER