diff options
author | Sean Griffin <sean@seantheprogrammer.com> | 2016-08-31 11:49:36 -0400 |
---|---|---|
committer | Sean Griffin <sean@seantheprogrammer.com> | 2016-08-31 11:50:53 -0400 |
commit | 03d3f036a71d433c661d167596989ae6896e911c (patch) | |
tree | e24867cde3a00b985bfaeb94cf8215cedb65cd33 /actionpack/lib/action_dispatch | |
parent | 4ba40bc2d6c31c1f5c38fe079cc6aaa2ef7ffa33 (diff) | |
download | rails-03d3f036a71d433c661d167596989ae6896e911c.tar.gz rails-03d3f036a71d433c661d167596989ae6896e911c.tar.bz2 rails-03d3f036a71d433c661d167596989ae6896e911c.zip |
Override `respond_to_missing?` instead of `respond_to?` when possible
This was almost every case where we are overriding `respond_to?` in a
way that mirrors a parallel implementation of `method_missing`. There is
one remaining case in Active Model that should probably do the same
thing, but had a sufficiently strange implementation that I want to
investigate it separately.
Fixes #26333.
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/routes_proxy.rb | 2 | ||||
-rw-r--r-- | actionpack/lib/action_dispatch/testing/integration.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/routing/routes_proxy.rb b/actionpack/lib/action_dispatch/routing/routes_proxy.rb index 3592683136..ee847eaeed 100644 --- a/actionpack/lib/action_dispatch/routing/routes_proxy.rb +++ b/actionpack/lib/action_dispatch/routing/routes_proxy.rb @@ -19,7 +19,7 @@ module ActionDispatch end end - def respond_to?(method, include_private = false) + def respond_to_missing?(method, include_private = false) super || @helpers.respond_to?(method) end diff --git a/actionpack/lib/action_dispatch/testing/integration.rb b/actionpack/lib/action_dispatch/testing/integration.rb index f5ec28a9c2..0082b3d8cb 100644 --- a/actionpack/lib/action_dispatch/testing/integration.rb +++ b/actionpack/lib/action_dispatch/testing/integration.rb @@ -502,7 +502,7 @@ module ActionDispatch integration_session.default_url_options = options end - def respond_to?(method, include_private = false) + def respond_to_missing?(method, include_private = false) integration_session.respond_to?(method, include_private) || super end |