diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2017-04-14 10:27:47 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-14 10:27:47 -0700 |
commit | e447c8c80a3f99a29286661eb47762535c249181 (patch) | |
tree | 7532907156d21f973f2187745e9c5996cdf0469d /activerecord/lib/active_record/attribute_methods | |
parent | 851b7f866e13518d900407c78dcd6eb477afad06 (diff) | |
parent | b5eb3215a68f94bb8cb20739366232c415744b83 (diff) | |
download | rails-e447c8c80a3f99a29286661eb47762535c249181.tar.gz rails-e447c8c80a3f99a29286661eb47762535c249181.tar.bz2 rails-e447c8c80a3f99a29286661eb47762535c249181.zip |
Merge pull request #28661 from bogdanvlviv/fix-dirty-attributes-if-override-attr_accessor
Fix inconsistency with changed attributes when overriding AR attribute reader
Diffstat (limited to 'activerecord/lib/active_record/attribute_methods')
-rw-r--r-- | activerecord/lib/active_record/attribute_methods/dirty.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/attribute_methods/dirty.rb b/activerecord/lib/active_record/attribute_methods/dirty.rb index bd5003d63a..63978cfb3e 100644 --- a/activerecord/lib/active_record/attribute_methods/dirty.rb +++ b/activerecord/lib/active_record/attribute_methods/dirty.rb @@ -328,6 +328,10 @@ module ActiveRecord def clear_changed_attributes_cache remove_instance_variable(:@cached_changed_attributes) if defined?(@cached_changed_attributes) end + + def _attributes(attr) + _read_attribute(attr) + end end end end |