aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/attribute_methods.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib/active_record/attribute_methods.rb')
-rw-r--r--activerecord/lib/active_record/attribute_methods.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/attribute_methods.rb b/activerecord/lib/active_record/attribute_methods.rb
index d7bfaa5655..3c9fafb1ca 100644
--- a/activerecord/lib/active_record/attribute_methods.rb
+++ b/activerecord/lib/active_record/attribute_methods.rb
@@ -29,12 +29,16 @@ module ActiveRecord
end
end
- def undefine_attribute_methods(*args)
+ def generated_attribute_methods
+ @generated_attribute_methods ||= (base_class == self ? super : base_class.generated_attribute_methods)
+ end
+
+ def undefine_attribute_methods
if base_class == self
super
@attribute_methods_generated = false
else
- base_class.undefine_attribute_methods(*args)
+ base_class.undefine_attribute_methods
end
end