Skip to content

Commit

Permalink
Check for method_missing in public and protected
Browse files Browse the repository at this point in the history
Ruby 2.0 changed the behavior of `respond_to?` without argument to
return only search for public method. We actually want to perform the
action only if `method_missing` is either in public or protected.
  • Loading branch information
sikachu committed Feb 24, 2013
1 parent abf0c71 commit 979e198
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion actionpack/lib/action_controller/metal/compatibility.rb
Expand Up @@ -58,7 +58,8 @@ def _handle_method_missing
end

def method_for_action(action_name)
super || (respond_to?(:method_missing) && "_handle_method_missing")
super || ((self.class.public_method_defined?(:method_missing) ||
self.class.protected_method_defined?(:method_missing)) && "_handle_method_missing")
end
end
end

0 comments on commit 979e198

Please sign in to comment.