2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-06 10:50:21 +08:00

DEV: Improve support for extending flags. (#8619)

- Ensure that the 'notify_moderators' flag is always the last flag when using custom flags.
- Support passign a custom FlagSettings object when replacing flags to reuse existing ones.
This commit is contained in:
Roman Rizzi 2019-12-27 08:41:50 -03:00 committed by GitHub
parent c25b8abd70
commit 16d97573f9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 6 deletions

View file

@ -127,8 +127,7 @@ class Plugin::Instance
end
# Applies to all sites in a multisite environment. Ignores plugin.enabled?
def replace_flags
settings = ::FlagSettings.new
def replace_flags(settings: ::FlagSettings.new)
yield settings
reloadable_patch do |plugin|