Sha256: 7e9dbedb7f7342b81c9e45a95e1616266bdacdae12ea93a46c500f56b5a2197a

Contents?: true

Size: 1.09 KB

Versions: 12

Compression:

Stored size: 1.09 KB

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.4.7 app/models/bridge_cache/live_course_session.rb
bridge_cache-0.4.6 app/models/bridge_cache/live_course_session.rb
bridge_cache-0.4.5 app/models/bridge_cache/live_course_session.rb
bridge_cache-0.4.4 app/models/bridge_cache/live_course_session.rb
bridge_cache-0.4.3 app/models/bridge_cache/live_course_session.rb
bridge_cache-0.4.2 app/models/bridge_cache/live_course_session.rb
bridge_cache-0.4.1 app/models/bridge_cache/live_course_session.rb
bridge_cache-0.3.24 app/models/bridge_cache/live_course_session.rb
bridge_cache-0.3.23 app/models/bridge_cache/live_course_session.rb
bridge_cache-0.3.22 app/models/bridge_cache/live_course_session.rb
bridge_cache-0.3.21 app/models/bridge_cache/live_course_session.rb
bridge_cache-0.3.20 app/models/bridge_cache/live_course_session.rb