Sha256: 4aeace117a61f971ac7c027ff91e63c88e68288d6f12e673f52a8e560073c47d
Contents?: true
Size: 464 Bytes
Versions: 15
Compression:
Stored size: 464 Bytes
Contents
# frozen_string_literal: true class Account < ActiveRecord::Base has_many :memberships, inverse_of: :account, dependent: :destroy, class_name: '::Account::Member' has_many :users, through: :memberships, inverse_of: :accounts where_ownership = -> { where(account_members: {role: :owner}) } has_one :ownership, where_ownership, dependent: nil, inverse_of: :account, class_name: '::Account::Member' has_one :owner, through: :ownership, source: :user end
Version data entries
15 entries across 8 versions & 3 rubygems