Permalink
Browse files

With this change I can do `load_and_authorize_resource :find_by => :get`

  • Loading branch information...
1 parent 6a01427 commit c849a1d953e4f8c745182aac89ab95f6817dda90 Corin Lawson committed May 20, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/cancan/controller_resource.rb
@@ -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

0 comments on commit c849a1d

Please sign in to comment.