Class: Pageflow::PotentialMemberships Private
- Inherits:
-
Object
- Object
- Pageflow::PotentialMemberships
- Defined in:
- app/models/pageflow/potential_memberships.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Class Method Summary collapse
- .creatable_by(user) ⇒ Object private
Instance Method Summary collapse
- #accounts_for_user(user) ⇒ Object private
- #entries_for_user(user) ⇒ Object private
-
#initialize(current_user) ⇒ PotentialMemberships
constructor
private
A new instance of PotentialMemberships.
- #users_for_account(account) ⇒ Object private
- #users_for_entry(entry) ⇒ Object private
Constructor Details
#initialize(current_user) ⇒ PotentialMemberships
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of PotentialMemberships.
4 5 6 |
# File 'app/models/pageflow/potential_memberships.rb', line 4 def initialize(current_user) @current_user = current_user end |
Class Method Details
Instance Method Details
#accounts_for_user(user) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
12 13 14 |
# File 'app/models/pageflow/potential_memberships.rb', line 12 def accounts_for_user(user) exclude_accounts_with_membership(user, managed_accounts) end |
#entries_for_user(user) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
16 17 18 |
# File 'app/models/pageflow/potential_memberships.rb', line 16 def entries_for_user(user) exclude_entries_with_membership(user, entries_managed_by_current_user_in_accounts_of(user)) end |
#users_for_account(account) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
20 21 22 |
# File 'app/models/pageflow/potential_memberships.rb', line 20 def users_for_account(account) exclude_users_with_membership(account, users_of_managed_accounts) end |
#users_for_entry(entry) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
24 25 26 27 |
# File 'app/models/pageflow/potential_memberships.rb', line 24 def users_for_entry(entry) return User.none unless manages_entry?(entry) exclude_users_with_membership(entry, entry.account.users) end |