2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-05 08:59:27 +08:00

Refactor flag types for more customization

This commit is contained in:
Robin Ward 2017-10-17 13:31:45 -04:00
parent e600fb79b3
commit 838568cbc3
26 changed files with 253 additions and 82 deletions

View file

@ -90,6 +90,15 @@ class Plugin::Instance
end
end
def replace_flags
settings = ::FlagSettings.new
yield settings
reloadable_patch do |plugin|
::PostActionType.replace_flag_settings(settings) if plugin.enabled?
end
end
def whitelist_staff_user_custom_field(field)
reloadable_patch do |plugin|
::User.register_plugin_staff_custom_field(field, plugin) if plugin.enabled?