From c5dee05a15c9374ec6ca09c7d43b4f264d1ab964 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Thu, 9 Jan 2025 17:21:29 +0000 Subject: [PATCH] Update autoload configuration Move ignored lib directories into the `autoload_lib` config. --- config/application.rb | 13 ++++++++++++- config/initializers/zeitwerk.rb | 6 ------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/config/application.rb b/config/application.rb index db0db97faa..6df511fb66 100644 --- a/config/application.rb +++ b/config/application.rb @@ -33,7 +33,18 @@ class Application < Rails::Application # Please, add to the `ignore` list any other `lib` subdirectories that do # not contain `.rb` files, or that should not be reloaded or eager loaded. # Common ones are `templates`, `generators`, or `middleware`, for example. - config.autoload_lib(ignore: %w(assets tasks)) + config.autoload_lib( + ignore: %w( + acts_as_xapian + assets + core_ext + custom_cops + generators + has_tag_string + tasks + themes + ) + ) # Configuration for the application, engines, and railties goes here. # diff --git a/config/initializers/zeitwerk.rb b/config/initializers/zeitwerk.rb index f07b3fe679..52ae40156c 100644 --- a/config/initializers/zeitwerk.rb +++ b/config/initializers/zeitwerk.rb @@ -9,13 +9,8 @@ ) Rails.autoloaders.main.ignore( - "lib/acts_as_xapian", "lib/confidence_intervals.rb", "lib/configuration.rb", - "lib/core_ext", - "lib/custom_cops", - "lib/generators", - "lib/has_tag_string", "lib/i18n_fixes.rb", "lib/languages.rb", "lib/mail_handler/backends/mail_extensions.rb", @@ -25,6 +20,5 @@ "lib/routing_filters.rb", "lib/stripe_mock_patch.rb", "lib/theme.rb", - "lib/themes", "lib/use_spans_for_errors.rb" )