Sha256: bada350938e97b6a1d92cc2f61ececfe7d66c85441faa4f4329bef7fb3caec1f

Contents?: true

Size: 509 Bytes

Versions: 9

Compression:

Stored size: 509 Bytes

Contents

module BridgeCache
  class ProgramEnrollment < BridgeBaseModel
    extend BridgeCache::Data::BridgeModel

    belongs_to :user, foreign_key: :user_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::User.name, optional: true
    belongs_to :program, foreign_key: :program_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::Program.name, optional: true

    def self.for_domain(domain_id)
      joins(:program).merge(BridgeCache::Program.for_domain(domain_id))
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
bridge_cache-0.3.8 app/models/bridge_cache/program_enrollment.rb
bridge_cache-0.3.7 app/models/bridge_cache/program_enrollment.rb
bridge_cache-0.3.6 app/models/bridge_cache/program_enrollment.rb
bridge_cache-0.3.5 app/models/bridge_cache/program_enrollment.rb
bridge_cache-0.3.4 app/models/bridge_cache/program_enrollment.rb
bridge_cache-0.3.3 app/models/bridge_cache/program_enrollment.rb
bridge_cache-0.3.2 app/models/bridge_cache/program_enrollment.rb
bridge_cache-0.3.01 app/models/bridge_cache/program_enrollment.rb
bridge_cache-0.3.0 app/models/bridge_cache/program_enrollment.rb