Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Check for `method_missing` in public and protected

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...
commit 979e198c14a95010aca17b6e640f386961360794 1 parent abf0c71
@sikachu sikachu authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  actionpack/lib/action_controller/metal/compatibility.rb
View
3  actionpack/lib/action_controller/metal/compatibility.rb
@@ -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.
Something went wrong with that request. Please try again.