ryanb/cancan — pull request #818 by anderslemke (2013-02-05 14:14:45+00:00)
Title: Explicitly return on load_resource if resource is already loaded

Hi Ryan,

I've been experiencing some problems using `:through`. Let's say I have a ressource `Thread`, which belongs to `Forum`. In `ThreadsController` I could then have

load_and_authorize_resource :through => :forum

It seems that the the `:through` will not respect an already loaded instance variable. If I have

before_filter :manually_set_thread # Which initailizes @thread
load_and_authorize_resource :through => :forum

the `load_resource`-part will run into problems, because this part `!current_ability.has_block?(authorization_action, resource_class)`.

Wouldn't it work if `load_resource` simply does nothing if `@thread` is already present?