Sha256: f16cdfaec96669ab9046732cf3155698aa66e12518be342b1e317eee6fe1df46

Contents?: true

Size: 622 Bytes

Versions: 10

Compression:

Stored size: 622 Bytes

Contents

module BridgeCache
  class GroupEnrollment < ApplicationRecord
    extend BridgeCache::Data::BridgeModel

    def self.for_domain(domain_id)
      joins(:course_template).where(bridge_cache_course_templates: { domain_id: domain_id })
    end

    belongs_to :group, foreign_key: :group_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::Group.name, optional: true
    belongs_to :course_template, foreign_key: :course_template_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::CourseTemplate.name, optional: true
    
    def self.unique_column_names
      %w[bridge_id]
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

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