Sha256: fdd0f0d2eece3c344a1de82ddc13dc721878ca8022c3922ce685ee6bc5405686

Contents?: true

Size: 940 Bytes

Versions: 12

Compression:

Stored size: 940 Bytes

Contents

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

    def self.for_domain(domain_id)
      joins(:live_course).merge(BridgeCache::LiveCourse.for_domain(domain_id))
    end

    belongs_to :domain, foreign_key: :domain_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::Domain.name, optional: true
    belongs_to :sub_account, foreign_key: :sub_account_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::Domain.name, optional: true
    belongs_to :live_course, foreign_key: :live_course_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::LiveCourse.name, optional: true
    has_many :live_course_session_registrations, foreign_key: :live_course_session_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::LiveCourseSessionRegistration.name

    def self.unique_column_names
      %w[bridge_id domain_id]
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
bridge_cache-0.3.19 app/models/bridge_cache/live_course_session.rb
bridge_cache-0.3.17 app/models/bridge_cache/live_course_session.rb
bridge_cache-0.3.16 app/models/bridge_cache/live_course_session.rb
bridge_cache-0.3.15 app/models/bridge_cache/live_course_session.rb
bridge_cache-0.3.14 app/models/bridge_cache/live_course_session.rb
bridge_cache-0.3.13 app/models/bridge_cache/live_course_session.rb
bridge_cache-0.3.12 app/models/bridge_cache/live_course_session.rb
bridge_cache-0.3.11 app/models/bridge_cache/live_course_session.rb
bridge_cache-0.3.10 app/models/bridge_cache/live_course_session.rb
bridge_cache-0.3.9 app/models/bridge_cache/live_course_session.rb
bridge_cache-0.3.8 app/models/bridge_cache/live_course_session.rb
bridge_cache-0.3.7 app/models/bridge_cache/live_course_session.rb