2233d73c39
completes #26
12 lines
352 B
Ruby
12 lines
352 B
Ruby
# frozen_string_literal: true
|
|
class Quiz < ApplicationRecord
|
|
has_many :questions, -> { order(:sort) }
|
|
has_many :candidates
|
|
has_many :reviewer_to_quizzes
|
|
has_many :reviewers, through: :reviewer_to_quizzes, source: :user
|
|
|
|
validates :name, presence: true, uniqueness: true
|
|
validates :dept, presence: true
|
|
validates :unit, presence: true
|
|
end
|