aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source/configuring.md
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2019-04-28 00:22:13 +0200
committerXavier Noria <fxn@hashref.com>2019-04-28 13:48:26 +0200
commitb6e17b6a4b67ccc9fac5fe16741c3db720f00959 (patch)
treeb95094671664b01428f934f2faff9ae7f7989490 /guides/source/configuring.md
parentf9330abd986ba59a534f10836875ce9c1199aced (diff)
downloadrails-b6e17b6a4b67ccc9fac5fe16741c3db720f00959.tar.gz
rails-b6e17b6a4b67ccc9fac5fe16741c3db720f00959.tar.bz2
rails-b6e17b6a4b67ccc9fac5fe16741c3db720f00959.zip
new config to opt-out from adding app directories to $LOAD_PATH
Diffstat (limited to 'guides/source/configuring.md')
-rw-r--r--guides/source/configuring.md2
1 files changed, 2 insertions, 0 deletions
diff --git a/guides/source/configuring.md b/guides/source/configuring.md
index 42da654fe7..b0173e5c97 100644
--- a/guides/source/configuring.md
+++ b/guides/source/configuring.md
@@ -64,6 +64,8 @@ These configuration methods are to be called on a `Rails::Railtie` object, such
* `config.autoload_paths` accepts an array of paths from which Rails will autoload constants. Default is all directories under `app`. It is no longer recommended to adjust this. See [Autoloading and Reloading Constants](autoloading_and_reloading_constants.html#autoload-paths-and-eager-load-paths)
+* `config.add_autoload_paths_to_load_path` says whether autoload paths have to be added to `$LOAD_PATH`. This flag is `true` by default, but it is recommended to be set to `false` in `:zeitwerk` mode early, in `config/application.rb`. Zeitwerk uses absolute paths internally, and applications running in `:zeitwerk` mode do not need `require_relative`, so models, controllers, jobs, etc. do not need to be in `$LOAD_PATH`. Setting this to `false` saves Ruby from checking these directories when resolving `require` calls with relative paths, and saves Bootsnap work and RAM, since it does not need to build an index for them.
+
* `config.cache_classes` controls whether or not application classes and modules should be reloaded on each request. Defaults to `false` in development mode, and `true` in test and production modes.
* `config.beginning_of_week` sets the default beginning of week for the