From dcb825902d79d0f6baba956f7c6ec5767611353e Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Mon, 13 May 2019 22:42:24 +0900 Subject: Don't track implicit `touch` mutation This partly reverts the effect of d1107f4d. d1107f4d makes `touch` tracks the mutation whether the `touch` is occurred by explicit or not. Existing apps expects that the previous changes tracks only the changes which is explicit action by users. I'd revert the implicit `touch` mutation tracking since I'd not like to break existing apps. Fixes #36219. --- activerecord/lib/active_record/touch_later.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'activerecord/lib/active_record/touch_later.rb') diff --git a/activerecord/lib/active_record/touch_later.rb b/activerecord/lib/active_record/touch_later.rb index 6872b7844e..bc63c8d987 100644 --- a/activerecord/lib/active_record/touch_later.rb +++ b/activerecord/lib/active_record/touch_later.rb @@ -44,6 +44,7 @@ module ActiveRecord def touch_deferred_attributes if has_defer_touch_attrs? && persisted? + @_skip_dirty_tracking = true touch(*@_defer_touch_attrs, time: @_touch_time) @_defer_touch_attrs, @_touch_time = nil, nil end -- cgit v1.2.3