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

undef_method can take varargs

This commit is contained in:
Akira Matsuda 2020-05-08 23:55:53 +09:00
parent d80c18a391
commit 1edf103b52

View file

@ -329,7 +329,7 @@ module ActiveModel
# person.name_short? # => NoMethodError # person.name_short? # => NoMethodError
def undefine_attribute_methods def undefine_attribute_methods
generated_attribute_methods.module_eval do generated_attribute_methods.module_eval do
instance_methods.each { |m| undef_method(m) } undef_method(*instance_methods)
end end
attribute_method_matchers_cache.clear attribute_method_matchers_cache.clear
end end