summaryrefslogtreecommitdiff
path: root/app/models/score.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/score.rb')
-rw-r--r--app/models/score.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/score.rb b/app/models/score.rb
index 5147ce0..ccc795f 100644
--- a/app/models/score.rb
+++ b/app/models/score.rb
@@ -3,4 +3,9 @@ class Score < ApplicationRecord
belongs_to :scoring_criterium
validates :value, presence: true, inclusion: { in: 1..5 }
+ validates :session_id, presence: true
+ validates :tartiflette_id, uniqueness: {
+ scope: [:scoring_criterium_id, :session_id],
+ message: "has already been scored for this session and criterium."
+ }
end
Copyright 2019--2025 Marius PETER