Skip to content

Commit

Permalink
cant check respond_to for a private method, rescue of params_method d…
Browse files Browse the repository at this point in the history
…oes not exist and run legacy method
  • Loading branch information
Michael King committed Nov 12, 2013
1 parent 132c896 commit 7ccd3f1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/cancan/controller_resource.rb
Expand Up @@ -224,9 +224,9 @@ def resource_params
end

def resource_params_by_namespaced_name
if @params_method && @controller.respond_to?(@params_method)

This comment has been minimized.

Copy link
@tobypinder

tobypinder Nov 15, 2013

I think you should be able to respond_to?(@params_method, true) here to check for private methods, though it's a fairly badly documented parameter in my experience

begin
@controller.send(@params_method)
else
rescue
@params[extract_key(namespaced_name)]
end
end
Expand Down

0 comments on commit 7ccd3f1

Please sign in to comment.