Sha256: 0902ec76118ead3a3ff14e7f53b3a7ae33c11f7a6c2cce8c2cdf7a2fe2683aa3

Contents?: true

Size: 566 Bytes

Versions: 10

Compression:

Stored size: 566 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
    
    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/membership.rb
bridge_cache-0.3.17 app/models/bridge_cache/membership.rb
bridge_cache-0.3.16 app/models/bridge_cache/membership.rb
bridge_cache-0.3.15 app/models/bridge_cache/membership.rb
bridge_cache-0.3.14 app/models/bridge_cache/membership.rb
bridge_cache-0.3.13 app/models/bridge_cache/membership.rb
bridge_cache-0.3.12 app/models/bridge_cache/membership.rb
bridge_cache-0.3.11 app/models/bridge_cache/membership.rb
bridge_cache-0.3.10 app/models/bridge_cache/membership.rb
bridge_cache-0.3.9 app/models/bridge_cache/membership.rb