skill-assessment-app/app/models/quiz.rb
2016-09-15 13:39:50 -05:00

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