Files
danbooru/script/fixes/094_mark_modreports_as_handled.rb
evazion c8d27c2719 Fix #4669: Track moderation report status.
* Add ability to mark moderation reports as 'handled' or 'rejected'.
* Automatically mark reports as handled when the comment or forum post
  is deleted.
* Send a dmail to the reporter when their report is handled.
* Don't show the report notice on comments or forum posts when all
  reports against it have been handled or rejected.
* Add a fix script to mark all existing reports for deleted comments,
  forum posts, or dmails as handled.
2022-01-20 20:50:23 -06:00

10 lines
410 B
Ruby
Executable File

#!/usr/bin/env ruby
require_relative "base"
with_confirmation do
ModerationReport.pending.where(model: Comment.deleted).update_all(status: :handled, updated_at: Time.zone.now)
ModerationReport.pending.where(model: ForumPost.deleted).update_all(status: :handled, updated_at: Time.zone.now)
ModerationReport.pending.where(model: Dmail.deleted).update_all(status: :handled, updated_at: Time.zone.now)
end