aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/deprecation
diff options
context:
space:
mode:
authorCharles Oliver Nutter <headius@headius.com>2015-10-13 11:16:49 -0500
committerCharles Oliver Nutter <headius@headius.com>2015-10-13 11:16:49 -0500
commitd29f7fbb10a9c8edeaf0d4f62b2195376eddd0b8 (patch)
tree61a2ef2610df0a3387c4e6209e3f4d117e3486aa /activesupport/lib/active_support/deprecation
parentde732e0015b356507b7c3554bcce2aa8818626c7 (diff)
downloadrails-d29f7fbb10a9c8edeaf0d4f62b2195376eddd0b8.tar.gz
rails-d29f7fbb10a9c8edeaf0d4f62b2195376eddd0b8.tar.bz2
rails-d29f7fbb10a9c8edeaf0d4f62b2195376eddd0b8.zip
Only prepend a single module when defining deprecation wrappers.
I could not find any reason why each method got its own prepended module here, and all tests appear to pass with my change.
Diffstat (limited to 'activesupport/lib/active_support/deprecation')
-rw-r--r--activesupport/lib/active_support/deprecation/method_wrappers.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/activesupport/lib/active_support/deprecation/method_wrappers.rb b/activesupport/lib/active_support/deprecation/method_wrappers.rb
index c74e9c40ac..91050d18f0 100644
--- a/activesupport/lib/active_support/deprecation/method_wrappers.rb
+++ b/activesupport/lib/active_support/deprecation/method_wrappers.rb
@@ -30,16 +30,16 @@ module ActiveSupport
deprecator = options.delete(:deprecator) || ActiveSupport::Deprecation.instance
method_names += options.keys
- method_names.each do |method_name|
- mod = Module.new do
+ mod = Module.new do
+ method_names.each do |method_name|
define_method(method_name) do |*args, &block|
deprecator.deprecation_warning(method_name, options[method_name])
super(*args, &block)
end
end
-
- target_module.prepend(mod)
end
+
+ target_module.prepend(mod)
end
end
end