elabs/pundit — pull request #10 by deefour (2013-01-08 21:58:10+00:00)
Title: Allows Scope to receive additional arguments

For times when scope resolution depends on data not related to the current user or the model/class, it may be useful to allow the Scope to accept more than just these two arguments.

As an example, I recently had to do something like this in a Rails action, basing the resolved scope in part on the request `params`.

```ruby
render json: policy_scope(user.articles, (params.include?(:historical)) && ::User::UserPolicy.new(current_user, user).manage?)
```