Class: PostPolicy::Scope
- Inherits:
-
Scope
- Object
- Scope
- PostPolicy::Scope
- Defined in:
- app/policies/post_policy.rb
Instance Method Summary collapse
Instance Method Details
#resolve ⇒ Object
4 5 6 7 8 9 10 |
# File 'app/policies/post_policy.rb', line 4 def resolve if user.admin? scope.unscoped else scope.unscoped.where(:user_id => user.id) end end |