Fix delete_all / destroy_all calls.

This commit is contained in:
evazion
2018-04-11 20:49:38 -05:00
parent d9d98f05c2
commit 4233d2149f
2 changed files with 3 additions and 3 deletions

View File

@@ -3,8 +3,8 @@ class DailyMaintenance
ActiveRecord::Base.connection.execute("set statement_timeout = 0") ActiveRecord::Base.connection.execute("set statement_timeout = 0")
PostPruner.new.prune! PostPruner.new.prune!
TagPruner.new.prune! TagPruner.new.prune!
Upload.delete_all(['created_at < ?', 1.day.ago]) Upload.where('created_at < ?', 1.day.ago).delete_all
Delayed::Job.delete_all(['created_at < ?', 45.days.ago]) Delayed::Job.where('created_at < ?', 45.days.ago).delete_all
PostVote.prune! PostVote.prune!
CommentVote.prune! CommentVote.prune!
ApiCacheGenerator.new.generate_tag_cache ApiCacheGenerator.new.generate_tag_cache

View File

@@ -5,7 +5,7 @@ class UserPasswordResetNonce < ApplicationRecord
after_create :deliver_notice after_create :deliver_notice
def self.prune! def self.prune!
destroy_all(["created_at < ?", 1.week.ago]) where("created_at < ?", 1.week.ago).destroy_all
end end
def deliver_notice def deliver_notice