Add pruning of reports older than a week

This commit is contained in:
BrokenEagle
2020-01-18 21:41:45 +00:00
parent a3e889bdf5
commit 491d476456
2 changed files with 5 additions and 0 deletions

View File

@@ -54,4 +54,8 @@ class ModerationReport < ApplicationRecord
q.apply_default_order(params)
end
def self.prune!
where("created_at < ?", 1.week.ago).delete_all
end
end