Skip to content

Commit 1a54c18

Browse files
committed
specify how to configure zeitwerk by itself
there's also related docs further down in the doc https://edgeguides.rubyonrails.org/upgrading_ruby_on_rails.html#how-to-use-the-classic-autoloader-in-rails-6
1 parent 9fb53e0 commit 1a54c18

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)