Skip to content

Commit bfb756b

Browse files
committed
Document new default of add_autoload_paths_to_load_path
1 parent ea5792a commit bfb756b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

guides/source/configuring.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ Below are the default values associated with each target version. In cases of co
6161
#### Default Values for Target Version 7.1
6262

6363
- [`config.action_dispatch.default_headers`](#config-action-dispatch-default-headers): `{ "X-Frame-Options" => "SAMEORIGIN", "X-XSS-Protection" => "0", "X-Content-Type-Options" => "nosniff", "X-Permitted-Cross-Domain-Policies" => "none", "Referrer-Policy" => "strict-origin-when-cross-origin" }`
64+
- [`add_autoload_paths_to_load_path`](#config-add-autoload-paths-to-load-path): `false`
6465

6566
#### Default Values for Target Version 7.0
6667

@@ -164,7 +165,14 @@ Accepts an array of paths from which Rails will autoload constants. Default is a
164165

165166
#### `config.add_autoload_paths_to_load_path`
166167

167-
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_dependency`, 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.
168+
Says whether autoload paths have to be added to `$LOAD_PATH`. 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_dependency`, 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.
169+
170+
The default value depends on the `config.load_defaults` target version:
171+
172+
| Starting with version | The default value is |
173+
| --------------------- | -------------------- |
174+
| (original) | `true` |
175+
| 7.1 | `false` |
168176

169177
#### `config.cache_classes`
170178

0 commit comments

Comments
 (0)