diff --git a/app/logical/daily_maintenance.rb b/app/logical/daily_maintenance.rb index e5d66318c..7e8b02d32 100644 --- a/app/logical/daily_maintenance.rb +++ b/app/logical/daily_maintenance.rb @@ -3,8 +3,8 @@ class DailyMaintenance ActiveRecord::Base.connection.execute("set statement_timeout = 0") PostPruner.new.prune! TagPruner.new.prune! - Upload.delete_all(['created_at < ?', 1.day.ago]) - Delayed::Job.delete_all(['created_at < ?', 45.days.ago]) + Upload.where('created_at < ?', 1.day.ago).delete_all + Delayed::Job.where('created_at < ?', 45.days.ago).delete_all PostVote.prune! CommentVote.prune! ApiCacheGenerator.new.generate_tag_cache diff --git a/app/models/user_password_reset_nonce.rb b/app/models/user_password_reset_nonce.rb index fbdc0e151..012720a2d 100644 --- a/app/models/user_password_reset_nonce.rb +++ b/app/models/user_password_reset_nonce.rb @@ -5,7 +5,7 @@ class UserPasswordResetNonce < ApplicationRecord after_create :deliver_notice def self.prune! - destroy_all(["created_at < ?", 1.week.ago]) + where("created_at < ?", 1.week.ago).destroy_all end def deliver_notice