Skip to content

Commit 4b4895e

Browse files
committed
Tweaks wording in guide [skip ci]
The way it was written, it was not 100% clear if that was the name to choose or the one to avoid.
1 parent 614fc3d commit 4b4895e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

guides/source/autoloading_and_reloading_constants.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ However, if an engine supports Rails 6 or Rails 6.1 and does not control its par
411411

412412
1. If `classic` mode would need a `require_dependency` call to ensure some constant is loaded at some point, write it. While `zeitwerk` would not need it, it won't hurt, will just work in `zeitwerk` mode too.
413413

414-
2. `classic` mode underscores constant names ("User" -> "user.rb"), and `zeitwerk` mode camelizes file names ("user.rb" -> "User"). They coincide in most cases, but they don't if there are series of consecutive uppercase letters as in "HTMLParser". The easiest way to be compatible is to avoid such names: "HtmlParser".
414+
2. `classic` mode underscores constant names ("User" -> "user.rb"), and `zeitwerk` mode camelizes file names ("user.rb" -> "User"). They coincide in most cases, but they don't if there are series of consecutive uppercase letters as in "HTMLParser". The easiest way to be compatible is to avoid such names. In this case, better pick "HtmlParser".
415415

416416
3. In `classic` mode, a file `app/model/concerns/foo.rb` is allowed to define both `Foo` and `Concerns::Foo`. In `zeitwerk` mode, there's only one option: it has to define `Foo`. In order to be compatible, define `Foo`.
417417

0 commit comments

Comments
 (0)