aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorMatthew Draper <matthew@trebex.net>2015-10-14 03:33:13 +1030
committerMatthew Draper <matthew@trebex.net>2015-10-14 03:33:13 +1030
commit8e7a3b056328c55e0c2a9cb51e46db443ebe8569 (patch)
tree61a2ef2610df0a3387c4e6209e3f4d117e3486aa /activesupport
parentde732e0015b356507b7c3554bcce2aa8818626c7 (diff)
parentd29f7fbb10a9c8edeaf0d4f62b2195376eddd0b8 (diff)
downloadrails-8e7a3b056328c55e0c2a9cb51e46db443ebe8569.tar.gz
rails-8e7a3b056328c55e0c2a9cb51e46db443ebe8569.tar.bz2
rails-8e7a3b056328c55e0c2a9cb51e46db443ebe8569.zip
Merge pull request #21952 from headius/only_one_module_for_deprecation
Only prepend a single module when defining deprecation wrappers.
Diffstat (limited to 'activesupport')
-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