Skip to content

Commit

Permalink
Fix authorization scope example
Browse files Browse the repository at this point in the history
  • Loading branch information
spohlenz committed Aug 25, 2020
1 parent 05d77ac commit 232ba55
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,10 @@ Finally, you can filter the collection scope using a custom scope block:
```ruby
authorize do
scope do |collection|
if user.admin?
if current_user.admin?
collection.all
else
collection.where(user: user)
collection.where(user: current_user)
end
end
end
Expand Down

0 comments on commit 232ba55

Please sign in to comment.