diff options
author | Marius Peter <marius.peter@tutanota.com> | 2025-01-01 17:49:39 +0100 |
---|---|---|
committer | Marius Peter <marius.peter@tutanota.com> | 2025-01-01 17:49:39 +0100 |
commit | e5bf7d1527491af4663c203ec17697e8855b650f (patch) | |
tree | 09f32d4ab8eecb22f1d4b4262f6e02769e645506 /app/models/score.rb | |
parent | 4d61303eb58cf32f95052227c3158a392dd23373 (diff) |
Cleaned up scores controller and tartiflette scoring service.
Diffstat (limited to 'app/models/score.rb')
-rw-r--r-- | app/models/score.rb | 5 |
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 |