Skip to content

Commit

Permalink
With this change I can do load_and_authorize_resource :find_by => :get
Browse files Browse the repository at this point in the history
  • Loading branch information
Corin Lawson committed May 20, 2011
1 parent 6a01427 commit c849a1d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/cancan/controller_resource.rb
Expand Up @@ -100,7 +100,8 @@ def find_resource
if @options[:singleton] && parent_resource.respond_to?(name)
parent_resource.send(name)
else
@options[:find_by] ? resource_base.send("find_by_#{@options[:find_by]}!", id_param) : resource_base.find(id_param)
@options[:find_by] ||= 'find'
resource_base.send(@options[:find_by].to_s, id_param)
end
end

Expand Down

0 comments on commit c849a1d

Please sign in to comment.