Merge pull request #705 from albertobajo/mongoid_find_by
Fixed load_resource "find_by" in mongoid resources
This commit is contained in:
commit
ba82241c0a
|
@ -107,6 +107,8 @@ module CanCan
|
|||
if @options[:find_by]
|
||||
if resource_base.respond_to? "find_by_#{@options[:find_by]}!"
|
||||
resource_base.send("find_by_#{@options[:find_by]}!", id_param)
|
||||
elsif resource_base.respond_to? "find_by"
|
||||
resource_base.send("find_by", { @options[:find_by].to_sym => id_param })
|
||||
else
|
||||
resource_base.send(@options[:find_by], id_param)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user