Sha256: 7977347cc9e872a134d6139222b4a8ace5005aff59e693121238f92ed0915794

Contents?: true

Size: 504 Bytes

Versions: 3

Compression:

Stored size: 504 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', optional: true
    belongs_to :program, foreign_key: :program_id, primary_key: BridgeCache.primary_key, class_name: 'BridgeCache::Program', optional: true

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

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
bridge_cache-0.2.2 app/models/bridge_cache/program_enrollment.rb
bridge_cache-0.2.1 app/models/bridge_cache/program_enrollment.rb
bridge_cache-0.2.0 app/models/bridge_cache/program_enrollment.rb