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:
parent
de732e0015
commit
d29f7fbb10
1 changed files with 4 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue