blob: ccc795f3c07777d890ea2c90f674350593f177bc (
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
|