From a7f8855cead26ba45a9e103ba4cac3ec9613bd00 Mon Sep 17 00:00:00 2001 From: Martin Gruner Date: Tue, 24 Aug 2021 09:56:12 +0200 Subject: [PATCH] Maintenance: Do not preload lib/. --- config/application.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/config/application.rb b/config/application.rb index d763fbcd7..d85a17491 100644 --- a/config/application.rb +++ b/config/application.rb @@ -43,8 +43,11 @@ module Zammad # Custom directories with classes and modules you want to be autoloadable. config.add_autoload_paths_to_load_path = false - config.autoload_paths += %W[#{config.root}/lib] - config.eager_load_paths += %W[#{config.root}/lib] + config.autoload_paths += %W[#{config.root}/lib] + + # zeitwerk:check will only check preloaded paths. To make sure that also lib/ gets validated, + # add it to the eager_load_paths only if zeitwerk:check is running. + config.eager_load_paths += %W[#{config.root}/lib] if ARGV[0].eql? 'zeitwerk:check' config.active_job.queue_adapter = :delayed_job