diff --git a/lib/discourse_plugin_registry.rb b/lib/discourse_plugin_registry.rb index 840b038977f..097db834c55 100644 --- a/lib/discourse_plugin_registry.rb +++ b/lib/discourse_plugin_registry.rb @@ -227,4 +227,11 @@ class DiscoursePluginRegistry end end + def self.reset_register!(register_name) + found_register = @@register_names.detect { |name| name == register_name } + + if found_register + instance_variable_set(:"@#{found_register}", nil) + end + end end