Sha256: 1ae411931857d089b8adf99e9d62f8c95388d955222f43db292120d664ba0096

Contents?: true

Size: 638 Bytes

Versions: 6

Compression:

Stored size: 638 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

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

    def to_s
      name
    end

  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
gaku_core-0.0.3 app/models/gaku/program.rb
gaku-0.0.3 core/app/models/gaku/program.rb
gaku-0.0.2 core/app/models/gaku/program.rb
gaku_core-0.0.2 app/models/gaku/program.rb
gaku-0.0.1 core/app/models/gaku/program.rb
gaku_core-0.0.1 app/models/gaku/program.rb