Class: Pageflow::PotentialMemberships Private

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

.creatable_by(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.



8
9
10
# File 'app/models/pageflow/potential_memberships.rb', line 8

def self.creatable_by(user)
  new(user)
end

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 ()
  exclude_users_with_membership(, 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..users)
end