Genshin/GAKUEngine

View on GitHub
core/app/models/gaku/exam_syllabus.rb

Summary

Maintainability
A
0 mins
Test Coverage
module Gaku
  class ExamSyllabus < ActiveRecord::Base
    belongs_to :syllabus, counter_cache: :exams_count
    belongs_to :exam

    validates :exam_id, presence: true

    validates :syllabus_id,
              presence: true,
              uniqueness: { scope: :exam_id,
                            message: I18n.t(:'exam.already_added') }
  end
end