aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/attribute_methods.rb
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2009-07-29 21:59:02 -0500
committerJoshua Peek <josh@joshpeek.com>2009-07-30 17:54:00 -0500
commite129c5673a99a09ae64759dafbe907aade16cf2b (patch)
tree55a893f4b4ba7350e374fc9899a58e3f1d007166 /activerecord/lib/active_record/attribute_methods.rb
parent586baf8ffea46f9daa96df7c0258591d89f57aeb (diff)
downloadrails-e129c5673a99a09ae64759dafbe907aade16cf2b.tar.gz
rails-e129c5673a99a09ae64759dafbe907aade16cf2b.tar.bz2
rails-e129c5673a99a09ae64759dafbe907aade16cf2b.zip
Wrap up attribute method reset concerns in 'undefine_attribute_methods'
Diffstat (limited to 'activerecord/lib/active_record/attribute_methods.rb')
-rw-r--r--activerecord/lib/active_record/attribute_methods.rb5
1 files changed, 5 insertions, 0 deletions
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)