gregbell/active_admin — pull request #2089 by macfanatic (2013-04-10 20:29:46+00:00)
Title: Resolves #587 adding :if & :unless proc arguments to scope_to() method

Provides the following DSL for conditionally scoping resources:

```ruby
ActiveAdmin.register Post do

# Only scope the query if there is a user to scope to, helper provided via Devise
scope_to :current_user, :if => proc{ admin_user_signed_in? }

# Don't scope the query if the user is an admin
scope_to :current_user, :unless => proc{ current_admin_user.admin? }

# Get fancy and can combine with block syntax
scope_to :if => proc{ admin_user_signed_in? } do
User.most_popular
end

end
```

Resolves issue #587.