Skip to content

Commit 46f9988

Browse files
authored
Merge pull request rails#46769 from corneverbruggen/corneverbruggen-sti-guides-fix
2 parents cd762a8 + bd19260 commit 46f9988

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

guides/source/autoloading_and_reloading_constants.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,9 +359,10 @@ In this example, we still want `app/models/shapes/circle.rb` to define `Circle`,
359359
```ruby
360360
# config/initializers/preload_stis.rb
361361

362+
shapes = "#{Rails.root}/app/models/shapes"
363+
Rails.autoloaders.main.collapse(shapes) # Not a namespace.
364+
362365
unless Rails.application.config.eager_load
363-
shapes = "#{Rails.root}/app/models/shapes"
364-
Rails.autoloaders.main.collapse(shapes) # Not a namespace.
365366
Rails.application.config.to_prepare do
366367
Rails.autoloaders.main.eager_load_dir(shapes)
367368
end

0 commit comments

Comments
 (0)