aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorPaul Nikitochkin <paul.nikitochkin@gmail.com>2013-07-05 01:13:59 +0300
committerPaul Nikitochkin <paul.nikitochkin@gmail.com>2013-07-05 17:13:54 +0300
commit1ecc3e83b6f62e2f6858c458231e3a49ef0bd916 (patch)
tree0a0b94bfbd8ba238803e0db8e4154faf7512375f /activerecord/lib
parent5ade0ddfe0cb963e7d41a6b5d50e28ee9df3bc00 (diff)
downloadrails-1ecc3e83b6f62e2f6858c458231e3a49ef0bd916.tar.gz
rails-1ecc3e83b6f62e2f6858c458231e3a49ef0bd916.tar.bz2
rails-1ecc3e83b6f62e2f6858c458231e3a49ef0bd916.zip
#11288: Removed duplicated touching
if belongs to model with touch option on touch Closes #11288
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/associations/builder/belongs_to.rb2
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