From 1edf103b528e91dbed987937936d73dab5452d81 Mon Sep 17 00:00:00 2001 From: Akira Matsuda Date: Fri, 8 May 2020 23:55:53 +0900 Subject: [PATCH] undef_method can take varargs --- activemodel/lib/active_model/attribute_methods.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/activemodel/lib/active_model/attribute_methods.rb b/activemodel/lib/active_model/attribute_methods.rb index 0c3d5ea701..f584ed99a4 100644 --- a/activemodel/lib/active_model/attribute_methods.rb +++ b/activemodel/lib/active_model/attribute_methods.rb @@ -329,7 +329,7 @@ module ActiveModel # person.name_short? # => NoMethodError def undefine_attribute_methods generated_attribute_methods.module_eval do - instance_methods.each { |m| undef_method(m) } + undef_method(*instance_methods) end attribute_method_matchers_cache.clear end