diff options
author | Sean Griffin <sean@thoughtbot.com> | 2014-06-20 11:36:23 -0600 |
---|---|---|
committer | Sean Griffin <sean@thoughtbot.com> | 2014-06-20 11:36:23 -0600 |
commit | 6d7ac31ddb9b5457177ee6b127624ad7e8cdd9d3 (patch) | |
tree | 692509e1b8a71c952f3b803d0cec8acb91b60949 /activerecord/lib/active_record/attribute_methods/dirty.rb | |
parent | 081eec4ba68d161623791d4f6c885ce0d442f31c (diff) | |
download | rails-6d7ac31ddb9b5457177ee6b127624ad7e8cdd9d3.tar.gz rails-6d7ac31ddb9b5457177ee6b127624ad7e8cdd9d3.tar.bz2 rails-6d7ac31ddb9b5457177ee6b127624ad7e8cdd9d3.zip |
Return a null object from `AttributeSet#[]`
Diffstat (limited to 'activerecord/lib/active_record/attribute_methods/dirty.rb')
-rw-r--r-- | activerecord/lib/active_record/attribute_methods/dirty.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/attribute_methods/dirty.rb b/activerecord/lib/active_record/attribute_methods/dirty.rb index ca71834641..e1a86fd3aa 100644 --- a/activerecord/lib/active_record/attribute_methods/dirty.rb +++ b/activerecord/lib/active_record/attribute_methods/dirty.rb @@ -129,7 +129,7 @@ module ActiveRecord end def _field_changed?(attr, old_value) - attribute_named(attr).changed_from?(old_value) + @attributes[attr].changed_from?(old_value) end def changed_in_place @@ -140,7 +140,7 @@ module ActiveRecord def changed_in_place?(attr_name) old_value = original_raw_attribute(attr_name) - attribute_named(attr_name).changed_in_place_from?(old_value) + @attributes[attr_name].changed_in_place_from?(old_value) end def original_raw_attribute(attr_name) @@ -154,7 +154,7 @@ module ActiveRecord end def store_original_raw_attribute(attr_name) - original_raw_attributes[attr_name] = attribute_named(attr_name).value_for_database + original_raw_attributes[attr_name] = @attributes[attr_name].value_for_database end def store_original_raw_attributes |