From a3322f36960306983983840e5f42d92dc3bc912d Mon Sep 17 00:00:00 2001 From: Joe Haig Date: Tue, 14 Jan 2025 16:33:33 +0000 Subject: [PATCH] 7.1 upgrade: Set add_autoload_paths_to_load_path --- config/application.rb | 10 ++++++++++ config/initializers/new_framework_defaults_7_1.rb | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/config/application.rb b/config/application.rb index ab9731c039..49b3fc97a9 100644 --- a/config/application.rb +++ b/config/application.rb @@ -19,6 +19,16 @@ class Application < Rails::Application # Initialize configuration defaults for originally generated Rails version. config.load_defaults 7.0 + ### 7.1 framework default + # No longer add autoloaded paths into `$LOAD_PATH`. This means that you won't be able + # to manually require files that are managed by the autoloader, which you shouldn't do anyway. + # + # This will reduce the size of the load path, making `require` faster if you don't use bootsnap, or reduce the size + # of the bootsnap cache if you use it. + # + # To set this configuration, add the following line to `config/application.rb` (NOT this file): + config.add_autoload_paths_to_load_path = false + config.middleware.use Rack::Deflater # Settings in config/environments/* take precedence over those specified here. # Application configuration should go into files in config/initializers diff --git a/config/initializers/new_framework_defaults_7_1.rb b/config/initializers/new_framework_defaults_7_1.rb index 3dc295db6d..19ff4bcd76 100644 --- a/config/initializers/new_framework_defaults_7_1.rb +++ b/config/initializers/new_framework_defaults_7_1.rb @@ -9,7 +9,7 @@ # Read the Guide for Upgrading Ruby on Rails for more info on each option. # https://guides.rubyonrails.org/upgrading_ruby_on_rails.html -### +### Updated in config/applicatoin.rb # No longer add autoloaded paths into `$LOAD_PATH`. This means that you won't be able # to manually require files that are managed by the autoloader, which you shouldn't do anyway. #