2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-07 12:02:53 +08:00

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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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