Class: Pageflow::AccountRoleQuery::Scope
- Inherits:
-
Scope
- Object
- Scope
- Pageflow::AccountRoleQuery::Scope
- Defined in:
- app/models/pageflow/account_role_query.rb
Overview
Query for accounts where a user has a given role.
Instance Method Summary collapse
-
#initialize(user, scope) ⇒ Scope
constructor
Create query scope.
-
#with_role_at_least(role) ⇒ ActiveRecord::Relation
Find all accounts where user has at least given role.
Constructor Details
Instance Method Details
#with_role_at_least(role) ⇒ ActiveRecord::Relation
Find all accounts where user has at least given role.
22 23 24 |
# File 'app/models/pageflow/account_role_query.rb', line 22 def with_role_at_least(role) scope.joins(with_membership_for_account(role)) end |