Genshin/GAKUEngine

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

Summary

Maintainability
A
0 mins
Test Coverage
module Gaku
  class Specialty < ActiveRecord::Base
    has_many :student_specialties
    has_many :students, through: :student_specialties

    has_many :program_specialties
    has_many :programs, through: :program_specialties

    belongs_to :department, required: false

    validates :name, presence: true, uniqueness: true

    def to_s
      name
    end
  end
end