Skip to content

Commit

Permalink
Drop conditional as zeitwerk is the only supported autoloader
Browse files Browse the repository at this point in the history
Part of the rails 7 upgrade:
ManageIQ#22052
  • Loading branch information
jrafanie committed Dec 4, 2023
1 parent 56ad2cc commit 9019050
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions config/initializers/zeitwerk.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
if Rails.application.config.autoloader == :zeitwerk && Rails.autoloaders.main
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:
# TODO: these should be either renamed with good names, the intermediate directory removed
# and/or both.
Rails.autoloaders.main.collapse(Rails.root.join("lib/manageiq/reporting/charting"))
Rails.autoloaders.main.collapse(Rails.root.join("lib/ansible/runner/credential"))
Rails.autoloaders.main.collapse(Rails.root.join("lib/pdf_generator"))
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:
# TODO: these should be either renamed with good names, the intermediate directory removed
# and/or both.
Rails.autoloaders.main.collapse(Rails.root.join("lib/manageiq/reporting/charting"))
Rails.autoloaders.main.collapse(Rails.root.join("lib/ansible/runner/credential"))
Rails.autoloaders.main.collapse(Rails.root.join("lib/pdf_generator"))

0 comments on commit 9019050

Please sign in to comment.