DEV: move post flags into database (#27125)

This is preparation for a feature that will allow admins to define their custom flags. Current behaviour should stay untouched.
This commit is contained in:
Krzysztof Kotlarek
2024-05-23 12:19:07 +10:00
committed by GitHub
parent 312a930ac8
commit cfbbfd177c
30 changed files with 380 additions and 104 deletions

View File

@ -197,6 +197,9 @@ class Plugin::Instance
# Applies to all sites in a multisite environment. Ignores plugin.enabled?
def replace_flags(settings: ::FlagSettings.new, score_type_names: [])
Discourse.deprecate(
"replace flags should not be used as flags were moved to the database. Instead, a flag record should be added to the database. Alternatively, soon, the admin will be able to do this in the admin panel.",
)
next_flag_id = ReviewableScore.types.values.max + 1
yield(settings, next_flag_id) if block_given?