aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/attribute_methods
diff options
context:
space:
mode:
authorbogdanvlviv <bogdanvlviv@gmail.com>2017-04-04 20:23:51 +0300
committerbogdanvlviv <bogdanvlviv@gmail.com>2017-04-12 08:06:13 +0300
commitb5eb3215a68f94bb8cb20739366232c415744b83 (patch)
tree991c873315009384453986698e3a77b2931077d2 /activerecord/lib/active_record/attribute_methods
parent2b4583f2a2ef94bc8c046e36e2b62ec642bbfb41 (diff)
downloadrails-b5eb3215a68f94bb8cb20739366232c415744b83.tar.gz
rails-b5eb3215a68f94bb8cb20739366232c415744b83.tar.bz2
rails-b5eb3215a68f94bb8cb20739366232c415744b83.zip
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.rb4
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