Fix delete_all / destroy_all calls.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user