DEV: Reduce repeated code in discourse_plugin_registry (#9705)

Use a helper method to simplify creating a new register. Previously this would require creating lots of different methods manually, and adding every register to the clear/reset functions
This commit is contained in:
David Taylor
2020-05-13 12:25:34 +01:00
committed by GitHub
parent 7d857d79bd
commit d4717f5d1e
4 changed files with 43 additions and 159 deletions

View File

@ -456,7 +456,6 @@ class Plugin::Instance
end
def register_custom_html(hash)
DiscoursePluginRegistry.custom_html ||= {}
DiscoursePluginRegistry.custom_html.merge!(hash)
end