Skip to content

Commit

Permalink
Merge pull request #21952 from headius/only_one_module_for_deprecation
Browse files Browse the repository at this point in the history
Only prepend a single module when defining deprecation wrappers.
  • Loading branch information
matthewd committed Oct 13, 2015
2 parents de732e0 + d29f7fb commit 8e7a3b0
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ def deprecate_methods(target_module, *method_names)
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
Expand Down

0 comments on commit 8e7a3b0

Please sign in to comment.