Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove base_controller_class loading in development #236

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions lib/mission_control/jobs/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,6 @@ class Engine < ::Rails::Engine
end

config.after_initialize do |app|
unless app.config.eager_load
# When loading classes lazily (development), we want to make sure
# the base host +ApplicationController+ class is loaded when loading the
# Engine's +ApplicationController+, or it will fail to load the class.
MissionControl::Jobs.base_controller_class.constantize
end

if MissionControl::Jobs.applications.empty?
queue_adapters_by_name = MissionControl::Jobs.adapters.each_with_object({}) do |adapter, hsh|
hsh[adapter] = ActiveJob::QueueAdapters.lookup(adapter).new
Expand Down
1 change: 1 addition & 0 deletions test/dummy/config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
config.solid_queue.connects_to = { database: { writing: :queue } }

config.mission_control.jobs.http_basic_auth_enabled = false
config.mission_control.jobs.base_controller_class = 'MyApplicationController'

# Silence Solid Queue logging
config.solid_queue.logger = ActiveSupport::Logger.new(nil)
Expand Down
4 changes: 4 additions & 0 deletions test/mission_control/jobs/base_application_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@ class MissionControl::Jobs::BaseApplicationControllerTest < ActiveSupport::TestC
test "engine's ApplicationController inherits from host's ApplicationController by default" do
assert MissionControl::Jobs::ApplicationController < ApplicationController
end

test "engine's ApplicationController inherits from configured base_controller_class" do
assert MissionControl::Jobs::ApplicationController < MyApplicationController
end
end