From 713fc39d93601043e027d5cd9ebcfa08064f9417 Mon Sep 17 00:00:00 2001 From: Brock Trappitt Date: Mon, 5 May 2014 20:24:04 +0800 Subject: Prevented belongs_to: touch propagating up if there are no changes being saved --- activerecord/lib/active_record/associations/builder/belongs_to.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib/active_record') diff --git a/activerecord/lib/active_record/associations/builder/belongs_to.rb b/activerecord/lib/active_record/associations/builder/belongs_to.rb index 47cc1f4b34..3998aca23e 100644 --- a/activerecord/lib/active_record/associations/builder/belongs_to.rb +++ b/activerecord/lib/active_record/associations/builder/belongs_to.rb @@ -103,7 +103,7 @@ module ActiveRecord::Associations::Builder BelongsTo.touch_record(record, foreign_key, n, touch) } - model.after_save callback + model.after_save callback, if: :changed? model.after_touch callback model.after_destroy callback end -- cgit v1.2.3