From 3c71ee9b90f57b0956e208c3f310d41ec028dc1e Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Fri, 13 Dec 2024 03:41:42 -0500 Subject: [PATCH] Use `touch_all` for time column updates (#33295) --- app/models/user.rb | 2 +- spec/services/reblog_service_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index 310ec77a15..ce24d34651 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -350,7 +350,7 @@ class User < ApplicationRecord end def revoke_access! - Doorkeeper::AccessGrant.by_resource_owner(self).update_all(revoked_at: Time.now.utc) + Doorkeeper::AccessGrant.by_resource_owner(self).touch_all(:revoked_at) Doorkeeper::AccessToken.by_resource_owner(self).in_batches do |batch| batch.touch_all(:revoked_at) diff --git a/spec/services/reblog_service_spec.rb b/spec/services/reblog_service_spec.rb index f807536a2e..ca3ee3ccdf 100644 --- a/spec/services/reblog_service_spec.rb +++ b/spec/services/reblog_service_spec.rb @@ -46,7 +46,7 @@ RSpec.describe ReblogService do Status .where(id: reblog_of_id) .where(text: 'discard-status-text') - .update_all(deleted_at: Time.now.utc) + .touch_all(:deleted_at) end end end