diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-09-17 16:26:49 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-09-17 16:26:49 -0300 |
commit | 168c0c171e1840211a57b8b7771e5c028cd79dc1 (patch) | |
tree | db128ba9a8f5eacc7ada810c8abf50af8fdad9d5 /activerecord/lib | |
parent | afa47805720bd7f315536fc08d5360a514cb2422 (diff) | |
download | rails-168c0c171e1840211a57b8b7771e5c028cd79dc1.tar.gz rails-168c0c171e1840211a57b8b7771e5c028cd79dc1.tar.bz2 rails-168c0c171e1840211a57b8b7771e5c028cd79dc1.zip |
Use has_attribute?
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/autosave_association.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/autosave_association.rb b/activerecord/lib/active_record/autosave_association.rb index 2a5dd758a3..c384e8c413 100644 --- a/activerecord/lib/active_record/autosave_association.rb +++ b/activerecord/lib/active_record/autosave_association.rb @@ -404,7 +404,7 @@ module ActiveRecord # If the record is new or it has changed, returns true. def record_changed?(reflection, record, key) record.new_record? || - (record.attributes.keys.include?(reflection.foreign_key) && record[reflection.foreign_key] != key) || + (record.has_attribute?(reflection.foreign_key) && record[reflection.foreign_key] != key) || record.attribute_changed?(reflection.foreign_key) end |