summaryrefslogtreecommitdiff
path: root/app/models/score.rb
blob: efbfee1ce8c007a8b0d2f0fbf406c5b0ff305ac4 (plain)
1
2
3
4
5
6
7
8
9
10
11
class Score < ApplicationRecord
  belongs_to :tartiflette
  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