ryanb/cancan — pull request #497 by morten (2011-10-25 04:21:30+00:00)
Title: Proposing expansion of the find_by scope

Allow the finder method to be a controller method for increased flexibility.

The use case for this is to allow existing applications to keep their finder
logic, e.g. projects that always want to go through an account scope or
that have logic to manage params for setting include directives on the finder level.

Example:

current_account.users.all(
:conditions => [ "roles = ? AND created_at > ?", params[:roles], 3.days.ago ],
:include => safe_params_includes
)

Having the ability to surface a finder method in the controller, we do not need
to push knowledge of params structure and the likes into a model.