Fix Rails/WhereRange cop (#30343)

This commit is contained in:
Matt Jankowski authored and GitHub committed 2024-05-20 09:37:36 +00:00
1 parent 70608f824e
commit def6b686ff
10 files changed
+15 -15

No files matched your search

+2 -2
View File
@@ -9,10 +9,10 @@ class Vacuum::ImportsVacuum
private
def clean_unconfirmed_imports!
BulkImport.state_unconfirmed.where('created_at <= ?', 10.minutes.ago).reorder(nil).in_batches.delete_all
BulkImport.state_unconfirmed.where(created_at: ..10.minutes.ago).reorder(nil).in_batches.delete_all
end
def clean_old_imports!
BulkImport.where('created_at <= ?', 1.week.ago).reorder(nil).in_batches.delete_all
BulkImport.where(created_at: ..1.week.ago).reorder(nil).in_batches.delete_all
end
end
+1 -1
View File
@@ -34,7 +34,7 @@ class Vacuum::StatusesVacuum
def statuses_scope
Status.unscoped.kept
.joins(:account).merge(Account.remote)
.where('statuses.id < ?', retention_period_as_id)
.where(statuses: { id: ...retention_period_as_id })
end
def retention_period_as_id