diff options
author | Prem Sichanugrist <s@sikac.hu> | 2013-02-22 14:26:20 -0500 |
---|---|---|
committer | Prem Sichanugrist <s@sikac.hu> | 2013-02-24 16:32:25 -0500 |
commit | 979e198c14a95010aca17b6e640f386961360794 (patch) | |
tree | 42c2c1a2c6edfe885fcf94b77c714bada05a23ac | |
parent | abf0c710210440e50b33b3e708b1e7e1dfbf9d65 (diff) | |
download | rails-979e198c14a95010aca17b6e640f386961360794.tar.gz rails-979e198c14a95010aca17b6e640f386961360794.tar.bz2 rails-979e198c14a95010aca17b6e640f386961360794.zip |
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.
-rw-r--r-- | actionpack/lib/action_controller/metal/compatibility.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/metal/compatibility.rb b/actionpack/lib/action_controller/metal/compatibility.rb index de3354d4f9..9d1ff8cbe4 100644 --- a/actionpack/lib/action_controller/metal/compatibility.rb +++ b/actionpack/lib/action_controller/metal/compatibility.rb @@ -58,7 +58,8 @@ module ActionController 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 |