diff --git a/lib/wizard/field.rb b/extensions/wizard_field.rb similarity index 86% rename from lib/wizard/field.rb rename to extensions/wizard_field.rb index c9bbdd04..87864032 100644 --- a/lib/wizard/field.rb +++ b/extensions/wizard_field.rb @@ -25,8 +25,4 @@ module CustomWizardFieldExtension def label @label ||= PrettyText.cook(@attrs[:label]) end -end - -class Wizard::Field - prepend CustomWizardFieldExtension if SiteSetting.custom_wizard_enabled end \ No newline at end of file diff --git a/lib/wizard/step.rb b/extensions/wizard_step.rb similarity index 53% rename from lib/wizard/step.rb rename to extensions/wizard_step.rb index b58bc837..b8af28ae 100644 --- a/lib/wizard/step.rb +++ b/extensions/wizard_step.rb @@ -1,7 +1,3 @@ module CustomWizardStepExtension attr_accessor :title, :description, :key, :permitted, :permitted_message -end - -class Wizard::Step - prepend CustomWizardStepExtension if SiteSetting.custom_wizard_enabled end \ No newline at end of file diff --git a/plugin.rb b/plugin.rb index f34eae64..d04ab66a 100644 --- a/plugin.rb +++ b/plugin.rb @@ -67,8 +67,6 @@ after_initialize do ../lib/custom_wizard/api/authorization.rb ../lib/custom_wizard/api/endpoint.rb ../lib/custom_wizard/api/log_entry.rb - ../lib/wizard/field.rb - ../lib/wizard/step.rb ../serializers/custom_wizard/api/authorization_serializer.rb ../serializers/custom_wizard/api/basic_endpoint_serializer.rb ../serializers/custom_wizard/api/endpoint_serializer.rb @@ -82,6 +80,8 @@ after_initialize do ../serializers/custom_wizard/log_serializer.rb ../extensions/extra_locales_controller.rb ../extensions/invites_controller.rb + ../extensions/wizard_field.rb + ../extensions/wizard_step.rb ].each do |path| load File.expand_path(path, __FILE__) end @@ -161,6 +161,8 @@ after_initialize do if enabled? ::ExtraLocalesController.prepend ExtraLocalesControllerCustomWizard ::InvitesController.prepend InvitesControllerCustomWizard + ::Wizard::Field.prepend CustomWizardFieldExtension + ::Wizard::Step.prepend CustomWizardStepExtension end end