Fix #4971: NoMethodError when trying to display some modreports.

Delete modreports for hard-deleted comments. There were a total of six
invalid modreports for deleted comments.
This commit is contained in:
evazion
2022-01-22 18:12:07 -06:00
parent 90be15e0b5
commit d2a24e6b10

View File

@@ -0,0 +1,14 @@
#!/usr/bin/env ruby
require_relative "base"
with_confirmation do
CurrentUser.scoped(User.system) do
ModerationReport.find_each do |report|
if report.invalid? && report.errors[:model] == ["must exist"]
puts "destroying modreport ##{report.id}"
report.destroy!
end
end
end
end