diff options
author | Matthew Draper <matthew@trebex.net> | 2017-09-01 16:09:37 +0930 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-01 16:09:37 +0930 |
commit | d0d7ce001bdbb0e5551da881caf8156c06238b84 (patch) | |
tree | dc9ed4628ea1e6f5d0f0591d76ac7024ca147814 /actionpack/lib/action_controller | |
parent | 2cd8ac1b68ba04ca12a816c8113271017b3c43c4 (diff) | |
parent | 50dbf817d43569c54300827b5f88702eba12dad6 (diff) | |
download | rails-d0d7ce001bdbb0e5551da881caf8156c06238b84.tar.gz rails-d0d7ce001bdbb0e5551da881caf8156c06238b84.tar.bz2 rails-d0d7ce001bdbb0e5551da881caf8156c06238b84.zip |
Merge pull request #29233 from matthewd/redefine-method
Clarify intentions around method redefinitions
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r-- | actionpack/lib/action_controller/metal/renderers.rb | 2 | ||||
-rw-r--r-- | actionpack/lib/action_controller/test_case.rb | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/metal/renderers.rb b/actionpack/lib/action_controller/metal/renderers.rb index 26752571f8..b81d3ef539 100644 --- a/actionpack/lib/action_controller/metal/renderers.rb +++ b/actionpack/lib/action_controller/metal/renderers.rb @@ -85,7 +85,7 @@ module ActionController def self.remove(key) RENDERERS.delete(key.to_sym) method_name = _render_with_renderer_method_name(key) - remove_method(method_name) if method_defined?(method_name) + remove_possible_method(method_name) end def self._render_with_renderer_method_name(key) diff --git a/actionpack/lib/action_controller/test_case.rb b/actionpack/lib/action_controller/test_case.rb index 50a96bce98..74d557fc18 100644 --- a/actionpack/lib/action_controller/test_case.rb +++ b/actionpack/lib/action_controller/test_case.rb @@ -4,6 +4,7 @@ require "rack/session/abstract/id" require "active_support/core_ext/hash/conversions" require "active_support/core_ext/object/to_query" require "active_support/core_ext/module/anonymous" +require "active_support/core_ext/module/redefine_method" require "active_support/core_ext/hash/keys" require "active_support/testing/constant_lookup" require_relative "template_assertions" @@ -19,7 +20,7 @@ module ActionController # the database on the main thread, so they could open a txn, then the # controller thread will open a new connection and try to access data # that's only visible to the main thread's txn. This is the problem in #23483. - remove_method :new_controller_thread + silence_redefinition_of_method :new_controller_thread def new_controller_thread # :nodoc: yield end |