mirror of
https://github.com/discourse/discourse.git
synced 2024-12-30 08:04:53 +08:00
f4d0a77d5f
We already add the "delete user" and "delete and block user" options to the drop-down for potential spam, but we should do this for potentially illegal posts as well. This is entirely based on the implementation for the potential spam one, including caching the status on the reviewable record. Also note that just as for potential spam, the user must be "deletable" for the option to appear. I also took the liberty to move the options in the drop-down to what I think is a more intuitive place. (Between delete post and suspend/silence user.)
17 lines
577 B
Ruby
17 lines
577 B
Ruby
# frozen_string_literal: true
|
|
#
|
|
class AddPotentiallyIllegalToReviewables < ActiveRecord::Migration[7.1]
|
|
def change
|
|
add_column :reviewables, :potentially_illegal, :boolean
|
|
|
|
up_only do
|
|
# NOTE: Only for records created after this migration. Trying to
|
|
# apply this as part of adding the column will attempt to backfill
|
|
# `false` into all existing reviewables. This is dangerous (locks
|
|
# a potentially huge table) and will create some false negatives.
|
|
#
|
|
change_column_default :reviewables, :potentially_illegal, false
|
|
end
|
|
end
|
|
end
|