Class: Pageflow::EntryRoleQuery::Scope
- Inherits:
-
Scope
- Object
- Scope
- Pageflow::EntryRoleQuery::Scope
- Defined in:
- app/models/pageflow/entry_role_query.rb
Instance Attribute Summary collapse
-
#scope ⇒ Object
readonly
Returns the value of attribute scope.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Instance Method Summary collapse
-
#initialize(user, scope, table_alias_prefix: nil) ⇒ Scope
constructor
A new instance of Scope.
- #with_account_role_at_least(role) ⇒ Object
- #with_role_at_least(role) ⇒ Object
Constructor Details
Instance Attribute Details
#scope ⇒ Object (readonly)
Returns the value of attribute scope.
4 5 6 |
# File 'app/models/pageflow/entry_role_query.rb', line 4 def scope @scope end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
4 5 6 |
# File 'app/models/pageflow/entry_role_query.rb', line 4 def user @user end |
Instance Method Details
#with_account_role_at_least(role) ⇒ Object
19 20 21 22 23 |
# File 'app/models/pageflow/entry_role_query.rb', line 19 def with_account_role_at_least(role) scope .joins(memberships_for_account_of_entries) .where(entry_account_membership_has_at_least_role(role)) end |
#with_role_at_least(role) ⇒ Object
12 13 14 15 16 17 |
# File 'app/models/pageflow/entry_role_query.rb', line 12 def with_role_at_least(role) scope .joins(memberships_for_account_of_entries) .joins(memberships_for_entries) .where(either_membership_has_at_least_role(role)) end |