1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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.
This commit is contained in:
Charles Oliver Nutter 2015-10-13 11:16:49 -05:00
parent de732e0015
commit d29f7fbb10

View file

@ -30,17 +30,17 @@ module ActiveSupport
deprecator = options.delete(:deprecator) || ActiveSupport::Deprecation.instance
method_names += options.keys
method_names.each do |method_name|
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
end
target_module.prepend(mod)
end
end
end
end
end