From dd2a1992aeb4c53f73453deef50c5ff9a5eb9421 Mon Sep 17 00:00:00 2001 From: Joe Rafaniello Date: Fri, 27 Oct 2023 11:52:12 -0400 Subject: [PATCH] Don't eager load a class needing qpid_proton loaded at load time This class can't be eager loaded because not all pratforms install qpid_proton and we need qpid_proton's class at load time. We can't install qpid_proton on mac but also don't want to install qpid's dependencies in CI in various providers, core, etc. --- config/initializers/zeitwerk.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/config/initializers/zeitwerk.rb b/config/initializers/zeitwerk.rb index 1e46e9d8e41a..b8e3a008c064 100644 --- a/config/initializers/zeitwerk.rb +++ b/config/initializers/zeitwerk.rb @@ -11,9 +11,8 @@ Rails.autoloaders.main.collapse(Rails.root.join("lib/ansible/runner/credential")) Rails.autoloaders.main.collapse(Rails.root.join("lib/pdf_generator")) - # requires qpid, which is an optional dependency because LOL mac - if RUBY_PLATFORM.include?("darwin") - message_handler_path = Pathname.new(Vmdb::Plugins.paths[ManageIQ::Providers::Nuage::Engine]).join("app/models/manageiq/providers/nuage/network_manager/event_catcher/messaging_handler.rb") - Rails.autoloaders.main.ignore(message_handler_path) - end + # The following file should not be eager loaded as it depends on being installed, which isn't possible on macs and isn't done by default + # in ci for other plugins, core, etc. + message_handler_path = Pathname.new(Vmdb::Plugins.paths[ManageIQ::Providers::Nuage::Engine]).join("app/models/manageiq/providers/nuage/network_manager/event_catcher/messaging_handler.rb") + Rails.autoloaders.main.ignore(message_handler_path) end