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")
|
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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user