Class: Pageflow::MembershipPolicy::Scope Private
- Inherits:
-
Scope
- Object
- Scope
- Pageflow::MembershipPolicy::Scope
- Defined in:
- app/policies/pageflow/membership_policy.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 Attribute Summary collapse
- #scope ⇒ Object readonly private
- #user ⇒ Object readonly private
Instance Method Summary collapse
- #indexable ⇒ Object private
-
#initialize(user, scope) ⇒ Scope
constructor
private
A new instance of Scope.
Constructor Details
#initialize(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.
8 9 10 11 |
# File 'app/policies/pageflow/membership_policy.rb', line 8 def initialize(user, scope) @user = user @scope = scope end |
Instance Attribute Details
#scope ⇒ Object (readonly)
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.
6 7 8 |
# File 'app/policies/pageflow/membership_policy.rb', line 6 def scope @scope end |
#user ⇒ Object (readonly)
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.
6 7 8 |
# File 'app/policies/pageflow/membership_policy.rb', line 6 def user @user end |
Instance Method Details
#indexable ⇒ 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.
13 14 15 16 17 18 19 |
# File 'app/policies/pageflow/membership_policy.rb', line 13 def indexable if user.admin? scope.all else scope.where().where(membership_is_present) end end |