diff options
author | Jon Leighton <j@jonathanleighton.com> | 2011-12-23 18:20:35 +0000 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2011-12-23 18:22:44 +0000 |
commit | 7bb754eaedcc49d7b085e417e741d42bb603e4c0 (patch) | |
tree | 837002d6f0c2ed38631063e3ae6628cb3ae91e20 /activerecord/lib/active_record/attribute_methods | |
parent | 6b9ab88a48c9625737a5603a0ac5dc60c25a88d9 (diff) | |
download | rails-7bb754eaedcc49d7b085e417e741d42bb603e4c0.tar.gz rails-7bb754eaedcc49d7b085e417e741d42bb603e4c0.tar.bz2 rails-7bb754eaedcc49d7b085e417e741d42bb603e4c0.zip |
Fix #4046.
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 |