Sha256: f2884d3d2f0efc4359c9d8032078b5ec9bdc7cc517be553b8d8732bb2d066502

Contents?: true

Size: 393 Bytes

Versions: 10

Compression:

Stored size: 393 Bytes

Contents

module Gaku
  class StudentSpecialty < ActiveRecord::Base
    belongs_to :specialty
    belongs_to :student

    validates :specialty_id, presence: true

    validates :student_id,
              presence: true,
              uniqueness: { scope: :specialty_id,
                            message: I18n.t(:'specialty.already_added') }

    scope :ordered, -> { order('major desc') }
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
gaku-0.2.4 core/app/models/gaku/student_specialty.rb
gaku_core-0.2.4 app/models/gaku/student_specialty.rb
gaku-0.2.3 core/app/models/gaku/student_specialty.rb
gaku_core-0.2.3 app/models/gaku/student_specialty.rb
gaku-0.2.2 core/app/models/gaku/student_specialty.rb
gaku_core-0.2.2 app/models/gaku/student_specialty.rb
gaku-0.2.1 core/app/models/gaku/student_specialty.rb
gaku_core-0.2.1 app/models/gaku/student_specialty.rb
gaku-0.2.0 core/app/models/gaku/student_specialty.rb
gaku_core-0.2.0 app/models/gaku/student_specialty.rb