Class: PostPolicy::Scope

Inherits:
Scope
  • Object
show all
Defined in:
app/policies/post_policy.rb

Instance Method Summary collapse

Instance Method Details

#resolveObject



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