Sha256: f32951fc1966fda34278dfd7a47c72525ca210f3bf3e6dfc82d9d751bd80f942

Contents?: true

Size: 674 Bytes

Versions: 16

Compression:

Stored size: 674 Bytes

Contents

module Gaku
  class Program < ActiveRecord::Base
    has_many :program_specialties
    has_many :specialties, through: :program_specialties

    has_many :program_levels
    has_many :levels, through: :program_levels

    has_many :program_syllabuses
    has_many :syllabuses, through: :program_syllabuses

    belongs_to :school

    validates :name, :school, presence: true
    validates :name, uniqueness: true

    accepts_nested_attributes_for :program_levels,
                                  :program_specialties,
                                  :program_syllabuses,
                                  allow_destroy: true

    def to_s
      name
    end
  end
end

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
gaku_core-0.3.0 app/models/gaku/program.rb
gaku_core-0.3.0.pre.4 app/models/gaku/program.rb
gaku_core-0.3.0.pre.3 app/models/gaku/program.rb
gaku_core-0.3.0.pre.2 app/models/gaku/program.rb
gaku_core-0.3.0.pre.1 app/models/gaku/program.rb
gaku_core-0.3.0.pre.0 app/models/gaku/program.rb
gaku-0.2.4 core/app/models/gaku/program.rb
gaku_core-0.2.4 app/models/gaku/program.rb
gaku-0.2.3 core/app/models/gaku/program.rb
gaku_core-0.2.3 app/models/gaku/program.rb
gaku-0.2.2 core/app/models/gaku/program.rb
gaku_core-0.2.2 app/models/gaku/program.rb
gaku-0.2.1 core/app/models/gaku/program.rb
gaku_core-0.2.1 app/models/gaku/program.rb
gaku-0.2.0 core/app/models/gaku/program.rb
gaku_core-0.2.0 app/models/gaku/program.rb