Class: Pageflow::ManagedUserQuery::Scope Private
- Inherits:
-
Scope
- Object
- Scope
- Pageflow::ManagedUserQuery::Scope
- Defined in:
- app/models/pageflow/managed_user_query.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.
Instance Method Summary collapse
-
#initialize(current_user, scope) ⇒ Scope
constructor
private
A new instance of Scope.
- #resolve ⇒ Object private
Constructor Details
#initialize(current_user, scope) ⇒ Scope
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 Scope.
5 6 7 8 |
# File 'app/models/pageflow/managed_user_query.rb', line 5 def initialize(current_user, scope) @current_user = current_user @scope = scope end |
Instance Method Details
#resolve ⇒ 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.
10 11 12 13 14 15 16 17 18 19 |
# File 'app/models/pageflow/managed_user_query.rb', line 10 def resolve if current_user.admin? scope.all else scope .distinct .joins(account_memberships) .joins(account_manager_memberships_of_current_user) end end |