Skip to content
Snippets Groups Projects
Commit ba82241c authored by Ryan Bates's avatar Ryan Bates
Browse files

Merge pull request #705 from albertobajo/mongoid_find_by

Fixed load_resource "find_by" in mongoid resources
parents cbd352c7 4a5700c0
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment