diff options
Diffstat (limited to 'activesupport/lib/active_support/deprecation/method_wrappers.rb')
-rw-r--r-- | activesupport/lib/active_support/deprecation/method_wrappers.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/deprecation/method_wrappers.rb b/activesupport/lib/active_support/deprecation/method_wrappers.rb index 257b70e34a..f4ad15cc63 100644 --- a/activesupport/lib/active_support/deprecation/method_wrappers.rb +++ b/activesupport/lib/active_support/deprecation/method_wrappers.rb @@ -32,8 +32,9 @@ module ActiveSupport target_module.alias_method_chain(method_name, :deprecation) do |target, punctuation| target_module.module_eval(<<-end_eval, __FILE__, __LINE__ + 1) def #{target}_with_deprecation#{punctuation}(*args, &block) - ::ActiveSupport::Deprecation.warn( - ::ActiveSupport::Deprecation.deprecated_method_warning( + deprecator = respond_to?(:deprecator) ? deprecator() : ActiveSupport::Deprecation + deprecator.warn( + deprecator.deprecated_method_warning( :#{method_name}, #{options[method_name].inspect}), caller |