From e129c5673a99a09ae64759dafbe907aade16cf2b Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Wed, 29 Jul 2009 21:59:02 -0500 Subject: Wrap up attribute method reset concerns in 'undefine_attribute_methods' --- activerecord/lib/active_record/attribute_methods.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'activerecord/lib/active_record/attribute_methods.rb') diff --git a/activerecord/lib/active_record/attribute_methods.rb b/activerecord/lib/active_record/attribute_methods.rb index ef510a1a2c..8370c212ca 100644 --- a/activerecord/lib/active_record/attribute_methods.rb +++ b/activerecord/lib/active_record/attribute_methods.rb @@ -79,6 +79,11 @@ module ActiveRecord end end + def undefine_attribute_methods + generated_methods.each { |name| undef_method(name) } + @generated_methods = nil + end + # Checks whether the method is defined in the model or any of its subclasses # that also derive from Active Record. def instance_method_already_implemented?(method_name) -- cgit v1.2.3