From c514898b848d21f818b056dd85a39d82070b8c17 Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Thu, 6 Aug 2020 10:46:06 +0200 Subject: [PATCH 1/2] config: don't explicitely eager-load controllers/concerns Per the documentation, Rails automatically loads `**/concerns` paths. See https://guides.rubyonrails.org/autoloading_and_reloading_constants_classic_mode.html#autoload-paths-and-eager-load-paths --- config/application.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/config/application.rb b/config/application.rb index d0d95339e..fa8dab189 100644 --- a/config/application.rb +++ b/config/application.rb @@ -32,7 +32,6 @@ module TPS config.i18n.available_locales = [:fr] config.paths.add "#{config.root}/lib", eager_load: true - config.paths.add "#{config.root}/app/controllers/concerns", eager_load: true config.assets.paths << Rails.root.join('app', 'assets', 'javascript') config.assets.paths << Rails.root.join('app', 'assets', 'fonts') From ededf5c6c50e4caa5dd003ca0c366e62eb08807b Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Thu, 6 Aug 2020 10:48:00 +0200 Subject: [PATCH 2/2] config: don't explicitely eager-load lib/ Rationale: - `lib/` is supposed to contain code mostly independant from Rails; - By default, Rails doesn't eager-load `lib/` anymore (this used to be the case, but since a few releases). If this commits triggers some errors, then these errors should be fixed (rather that `lib/` being added again to the load path). --- config/application.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/config/application.rb b/config/application.rb index fa8dab189..427b10d16 100644 --- a/config/application.rb +++ b/config/application.rb @@ -31,8 +31,6 @@ module TPS config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}')] config.i18n.available_locales = [:fr] - config.paths.add "#{config.root}/lib", eager_load: true - config.assets.paths << Rails.root.join('app', 'assets', 'javascript') config.assets.paths << Rails.root.join('app', 'assets', 'fonts') config.assets.precompile += ['.woff']