Class: Pageflow::MembershipPolicy::Scope
- Inherits:
-
Scope
- Object
- Scope
- Pageflow::MembershipPolicy::Scope
- Defined in:
- app/policies/pageflow/membership_policy.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
- #indexable ⇒ Object
-
#initialize(user, scope) ⇒ Scope
constructor
A new instance of Scope.
Constructor Details
Instance Attribute Details
#scope ⇒ Object (readonly)
Returns the value of attribute scope.
4 5 6 |
# File 'app/policies/pageflow/membership_policy.rb', line 4 def scope @scope end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
4 5 6 |
# File 'app/policies/pageflow/membership_policy.rb', line 4 def user @user end |
Instance Method Details
#indexable ⇒ Object
11 12 13 14 15 16 17 |
# File 'app/policies/pageflow/membership_policy.rb', line 11 def indexable if user.admin? scope.all else scope.where().where(membership_is_present) end end |