Skip to content

Commit 1eab332

Browse files
authored
Merge pull request rails#43278 from jjb/patch-2
specify how to enable zeitwerk by itself
2 parents 8f9f7e7 + 1a54c18 commit 1eab332

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

guides/source/upgrading_ruby_on_rails.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,14 @@ config.load_defaults 6.0
603603

604604
enables `zeitwerk` autoloading mode on CRuby. In that mode, autoloading, reloading, and eager loading are managed by [Zeitwerk](https://github.com/fxn/zeitwerk).
605605

606+
If you are using defaults from a previous Rails version, you can enable zeitwerk like so:
607+
608+
```ruby
609+
# config/application.rb
610+
611+
config.autoloader = :zeitwerk
612+
```
613+
606614
#### Public API
607615

608616
In general, applications do not need to use the API of Zeitwerk directly. Rails sets things up according to the existing contract: `config.autoload_paths`, `config.cache_classes`, etc.

0 commit comments

Comments
 (0)