1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #40163 from p8/guides/improve-sentence-in-classic-mode-guide

Fix strange sentence in classic_mode guide [skip ci]
This commit is contained in:
Daniel Colson 2020-09-03 08:01:33 -04:00 committed by GitHub
commit 3d27653dfd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -477,8 +477,14 @@ How files are autoloaded depends on `eager_load` and `cache_classes` config sett
* In **production**, however, you want consistency and thread-safety and can live with a longer boot time. So `eager_load` is set to `true`, and then during boot (before the app is ready to receive requests) Rails loads all files in the `eager_load_paths` and then turns off auto loading (NB: autoloading may be needed during eager loading). Not autoloading after boot is a `good thing`, as autoloading can cause the app to be have thread-safety problems. * In **production**, however, you want consistency and thread-safety and can live with a longer boot time. So `eager_load` is set to `true`, and then during boot (before the app is ready to receive requests) Rails loads all files in the `eager_load_paths` and then turns off auto loading (NB: autoloading may be needed during eager loading). Not autoloading after boot is a `good thing`, as autoloading can cause the app to be have thread-safety problems.
* In **test**, for speed of execution (of individual tests) `eager_load` is `false`, so Rails follows development behaviour. * In **test**, for speed of execution (of individual tests) `eager_load` is `false`, so Rails follows development behaviour.
What is described above are the defaults with a newly generated Rails app. There are multiple ways this can be configured differently (see [Configuring Rails Applications](configuring.html#rails-general-configuration). What is described above are the defaults with a newly generated Rails app.
). But using `autoload_paths` on its own in the past (before Rails 5) developers might configure `autoload_paths` to add in extra locations (e.g. `lib` which used to be an autoload path list years ago, but no longer is). However this is now discouraged for most purposes, as it is likely to lead to production-only errors. It is possible to add new locations to both `config.eager_load_paths` and `config.autoload_paths` but use at your own risk. There are multiple ways this can be configured differently (see [Configuring
Rails Applications](configuring.html#rails-general-configuration).). Before
Rails 5 developers might configure `autoload_paths` to add in extra locations
(e.g. `lib` which used to be an autoload path list years ago, but no longer
is). However this is now discouraged for most purposes, as it is likely to
lead to production-only errors. It is possible to add new locations to both
`config.eager_load_paths` and `config.autoload_paths` but use at your own risk.
See also [Autoloading in the Test Environment](#autoloading-in-the-test-environment). See also [Autoloading in the Test Environment](#autoloading-in-the-test-environment).