summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorMarius Peter <marius.peter@tutanota.com>2025-01-01 17:49:39 +0100
committerMarius Peter <marius.peter@tutanota.com>2025-01-01 17:49:39 +0100
commite5bf7d1527491af4663c203ec17697e8855b650f (patch)
tree09f32d4ab8eecb22f1d4b4262f6e02769e645506 /app/models
parent4d61303eb58cf32f95052227c3158a392dd23373 (diff)
Cleaned up scores controller and tartiflette scoring service.
Diffstat (limited to 'app/models')
-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