diff --git a/config/application.rb b/config/application.rb index f29aca46797..bf4963c3f75 100644 --- a/config/application.rb +++ b/config/application.rb @@ -164,9 +164,11 @@ class Application < Rails::Application end initializer :eager_load_all_the_things, :after => :load_config_initializers do - config.eager_load_paths += config.autoload_paths - Vmdb::Plugins.each do |plugin| - plugin.config.eager_load_paths += plugin.config.autoload_paths + if ENV['DEBUG_MANAGEIQ_ZEITWERK'].present? + config.eager_load_paths += config.autoload_paths + Vmdb::Plugins.each do |plugin| + plugin.config.eager_load_paths += plugin.config.autoload_paths + end end end diff --git a/config/initializers/zeitwerk.rb b/config/initializers/zeitwerk.rb index 5705e26024e..3dbe62b6b02 100644 --- a/config/initializers/zeitwerk.rb +++ b/config/initializers/zeitwerk.rb @@ -1,6 +1,8 @@ if Rails.application.config.autoloader == :zeitwerk && Rails.autoloaders.main - Zeitwerk::Loader.default_logger = method(:puts) - Rails.autoloaders.main.logger = Logger.new(STDOUT) + if ENV['DEBUG_MANAGEIQ_ZEITWERK'].present? + Zeitwerk::Loader.default_logger = method(:puts) + Rails.autoloaders.main.logger = Logger.new(STDOUT) + end # These specific directories are for code organization, not namespacing: Rails.autoloaders.main.collapse(Rails.root.join("lib/manageiq/reporting/charting"))