Sha256: c58c060b19827cd51bba4299a6a14d32deb0169cc4fe6102103b56d820c84c6d

Contents?: true

Size: 500 Bytes

Versions: 9

Compression:

Stored size: 500 Bytes

Contents

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

    belongs_to :group, foreign_key: :group_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::Group.name, optional: true
    belongs_to :user, foreign_key: :group_id, primary_key: BridgeCache.primary_key, class_name: BridgeCache::User.name, optional: true

    def self.for_domain(domain_id)
      joins(:group).where(bridge_cache_groups: { domain_id: 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/membership.rb
bridge_cache-0.3.7 app/models/bridge_cache/membership.rb
bridge_cache-0.3.6 app/models/bridge_cache/membership.rb
bridge_cache-0.3.5 app/models/bridge_cache/membership.rb
bridge_cache-0.3.4 app/models/bridge_cache/membership.rb
bridge_cache-0.3.3 app/models/bridge_cache/membership.rb
bridge_cache-0.3.2 app/models/bridge_cache/membership.rb
bridge_cache-0.3.01 app/models/bridge_cache/membership.rb
bridge_cache-0.3.0 app/models/bridge_cache/membership.rb