Sha256: b48c69e7264298c61a3abdfd51319f79b0ecc365250f6efb1d7479002da8b978

Contents?: true

Size: 362 Bytes

Versions: 16

Compression:

Stored size: 362 Bytes

Contents

module Semesterable
  extend ActiveSupport::Concern

  included do
    has_many :semester_connectors, as: :semesterable, dependent: :destroy
    has_many :semesters, through: :semester_connectors, source: :semester

    scope :without_semester,
          -> { includes(:semester_connectors).where(gaku_semester_connectors: { semesterable_id: nil }) }

  end
end

Version data entries

16 entries across 16 versions & 2 rubygems

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