diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-07-06 17:33:26 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-07-06 17:33:26 -0300 |
commit | 7948d7890548a3e70d04dfed26497b391920b058 (patch) | |
tree | 2056056a8a2e1a8efcb7e88f69e40f83e949427b /activerecord/lib/active_record | |
parent | 8d8d4b7782145aedc0604d9179931ec9b9b5225a (diff) | |
parent | 1ecc3e83b6f62e2f6858c458231e3a49ef0bd916 (diff) | |
download | rails-7948d7890548a3e70d04dfed26497b391920b058.tar.gz rails-7948d7890548a3e70d04dfed26497b391920b058.tar.bz2 rails-7948d7890548a3e70d04dfed26497b391920b058.zip |
Merge pull request #11306 from jetthoughts/11288_remove_extra_queries_for_belongs_to_with_touch
#11288: Removed duplicated touching
Conflicts:
activerecord/CHANGELOG.md
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/associations/builder/belongs_to.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/builder/belongs_to.rb b/activerecord/lib/active_record/associations/builder/belongs_to.rb index d4e1a0dda1..81293e464d 100644 --- a/activerecord/lib/active_record/associations/builder/belongs_to.rb +++ b/activerecord/lib/active_record/associations/builder/belongs_to.rb @@ -92,7 +92,7 @@ module ActiveRecord::Associations::Builder end def self.touch_record(o, foreign_key, name, touch) # :nodoc: - old_foreign_id = o.attribute_was(foreign_key) + old_foreign_id = o.changed_attributes[foreign_key] if old_foreign_id klass = o.association(name).klass |