From 954dea0af97a5a3c973ebeb888eae00060777984 Mon Sep 17 00:00:00 2001 From: Angus McLeod Date: Thu, 3 Oct 2019 15:17:21 +1000 Subject: [PATCH] zeitwork compatibility --- controllers/steps.rb | 2 +- jobs/clear_after_time_wizard.rb | 2 +- jobs/refresh_api_access_token.rb | 2 +- jobs/set_after_time_wizard.rb | 2 +- lib/wizard.rb | 5 ----- lib/wizard_edits.rb | 4 ---- plugin.rb | 3 --- serializers/api/api_serializer.rb | 2 +- serializers/api/authorization_serializer.rb | 2 +- serializers/api/basic_api_serializer.rb | 2 +- serializers/api/basic_endpoint_serializer.rb | 2 +- serializers/api/endpoint_serializer.rb | 2 +- serializers/api/log_serializer.rb | 2 +- 13 files changed, 10 insertions(+), 22 deletions(-) diff --git a/controllers/steps.rb b/controllers/steps.rb index c66c7bfe..a627b960 100644 --- a/controllers/steps.rb +++ b/controllers/steps.rb @@ -1,4 +1,4 @@ -class CustomWizard::StepsController < ApplicationController +class CustomWizard::StepsController < ::ApplicationController before_action :ensure_logged_in def update diff --git a/jobs/clear_after_time_wizard.rb b/jobs/clear_after_time_wizard.rb index 4b53e5b9..ffaa6fa9 100644 --- a/jobs/clear_after_time_wizard.rb +++ b/jobs/clear_after_time_wizard.rb @@ -1,5 +1,5 @@ module Jobs - class ClearAfterTimeWizard < Jobs::Base + class ClearAfterTimeWizard < ::Jobs::Base sidekiq_options queue: 'critical' def execute(args) diff --git a/jobs/refresh_api_access_token.rb b/jobs/refresh_api_access_token.rb index 54f6da55..114c39d1 100644 --- a/jobs/refresh_api_access_token.rb +++ b/jobs/refresh_api_access_token.rb @@ -1,5 +1,5 @@ module Jobs - class RefreshApiAccessToken < Jobs::Base + class RefreshApiAccessToken < ::Jobs::Base def execute(args) CustomWizard::Api::Authorization.get_token(args[:name], refresh: true) end diff --git a/jobs/set_after_time_wizard.rb b/jobs/set_after_time_wizard.rb index e3ec5ee3..76d408d4 100644 --- a/jobs/set_after_time_wizard.rb +++ b/jobs/set_after_time_wizard.rb @@ -1,5 +1,5 @@ module Jobs - class SetAfterTimeWizard < Jobs::Base + class SetAfterTimeWizard < ::Jobs::Base def execute(args) if CustomWizard::Wizard.find(args[:wizard_id]) user_ids = [] diff --git a/lib/wizard.rb b/lib/wizard.rb index b47d68f1..879d6f2b 100644 --- a/lib/wizard.rb +++ b/lib/wizard.rb @@ -1,8 +1,3 @@ -require_dependency 'wizard/step' -require_dependency 'wizard/field' -require_dependency 'wizard/step_updater' -require_dependency 'wizard/builder' - class CustomWizard::Wizard attr_reader :steps, :user diff --git a/lib/wizard_edits.rb b/lib/wizard_edits.rb index 11aa7ed8..e1ff2dc4 100644 --- a/lib/wizard_edits.rb +++ b/lib/wizard_edits.rb @@ -1,7 +1,3 @@ -require_dependency 'wizard' -require_dependency 'wizard/field' -require_dependency 'wizard/step' - ::Wizard.class_eval do def self.user_requires_completion?(user) wizard_result = self.new(user).requires_completion? diff --git a/plugin.rb b/plugin.rb index 957682ef..222aac34 100644 --- a/plugin.rb +++ b/plugin.rb @@ -36,7 +36,6 @@ end after_initialize do UserHistory.actions[:custom_wizard_step] = 1000 - require_dependency 'application_controller' module ::CustomWizard class Engine < ::Rails::Engine engine_name 'custom_wizard' @@ -52,7 +51,6 @@ after_initialize do put ':wizard_id/steps/:step_id' => 'steps#update' end - require_dependency 'admin_constraint' Discourse::Application.routes.append do mount ::CustomWizard::Engine, at: 'w' post 'wizard/authorization/callback' => "custom_wizard/authorization#callback" @@ -139,7 +137,6 @@ after_initialize do end end - require_dependency 'invites_controller' class ::InvitesController prepend InvitesControllerCustomWizard end diff --git a/serializers/api/api_serializer.rb b/serializers/api/api_serializer.rb index 9d7fba70..1fa601a3 100644 --- a/serializers/api/api_serializer.rb +++ b/serializers/api/api_serializer.rb @@ -1,4 +1,4 @@ -class CustomWizard::ApiSerializer < ApplicationSerializer +class CustomWizard::ApiSerializer < ::ApplicationSerializer attributes :name, :title, :authorization, diff --git a/serializers/api/authorization_serializer.rb b/serializers/api/authorization_serializer.rb index 2ca347b5..fe6e7444 100644 --- a/serializers/api/authorization_serializer.rb +++ b/serializers/api/authorization_serializer.rb @@ -1,4 +1,4 @@ -class CustomWizard::Api::AuthorizationSerializer < ApplicationSerializer +class CustomWizard::Api::AuthorizationSerializer < ::ApplicationSerializer attributes :auth_type, :auth_url, :token_url, diff --git a/serializers/api/basic_api_serializer.rb b/serializers/api/basic_api_serializer.rb index d0214d65..5b037650 100644 --- a/serializers/api/basic_api_serializer.rb +++ b/serializers/api/basic_api_serializer.rb @@ -1,4 +1,4 @@ -class CustomWizard::BasicApiSerializer < ApplicationSerializer +class CustomWizard::BasicApiSerializer < ::ApplicationSerializer attributes :name, :title, :endpoints diff --git a/serializers/api/basic_endpoint_serializer.rb b/serializers/api/basic_endpoint_serializer.rb index e2cc2262..63758c48 100644 --- a/serializers/api/basic_endpoint_serializer.rb +++ b/serializers/api/basic_endpoint_serializer.rb @@ -1,4 +1,4 @@ -class CustomWizard::Api::BasicEndpointSerializer < ApplicationSerializer +class CustomWizard::Api::BasicEndpointSerializer < ::ApplicationSerializer attributes :id, :name end diff --git a/serializers/api/endpoint_serializer.rb b/serializers/api/endpoint_serializer.rb index 31d0f975..0430bea3 100644 --- a/serializers/api/endpoint_serializer.rb +++ b/serializers/api/endpoint_serializer.rb @@ -1,4 +1,4 @@ -class CustomWizard::Api::EndpointSerializer < ApplicationSerializer +class CustomWizard::Api::EndpointSerializer < ::ApplicationSerializer attributes :id, :name, :method, diff --git a/serializers/api/log_serializer.rb b/serializers/api/log_serializer.rb index 13ee1555..819185b5 100644 --- a/serializers/api/log_serializer.rb +++ b/serializers/api/log_serializer.rb @@ -1,4 +1,4 @@ -class CustomWizard::Api::LogSerializer < ApplicationSerializer +class CustomWizard::Api::LogSerializer < ::ApplicationSerializer attributes :log_id, :time, :status,