Use `touch_all` for time column updates (#33295)

pull/33300/head
Matt Jankowski 1 month ago committed by GitHub
parent 234af14966
commit 3c71ee9b90
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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)

@ -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

Loading…
Cancel
Save