diff options
Diffstat (limited to 'activerecord/lib/active_record/attribute_methods')
-rw-r--r-- | activerecord/lib/active_record/attribute_methods/read.rb | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/attribute_methods/read.rb b/activerecord/lib/active_record/attribute_methods/read.rb index a83d944d1b..995e2b2e58 100644 --- a/activerecord/lib/active_record/attribute_methods/read.rb +++ b/activerecord/lib/active_record/attribute_methods/read.rb @@ -30,10 +30,8 @@ module ActiveRecord end def undefine_attribute_methods - if base_class == self - generated_external_attribute_methods.module_eval do - instance_methods.each { |m| undef_method(m) } - end + generated_external_attribute_methods.module_eval do + instance_methods.each { |m| undef_method(m) } end super @@ -80,6 +78,7 @@ module ActiveRecord STR generated_external_attribute_methods.module_eval <<-STR, __FILE__, __LINE__ + 1 + # raise if method_defined?('#{attr_name}') def __temp__(v, attributes, attributes_cache, attr_name) #{external_attribute_access_code(attr_name, cast_code)} end |