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
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|