mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
* Fixes #40218 Clarify the difference between Railtie initializers and config initializers in the initialization guide. * Update guides/source/initialization.md Co-authored-by: Alan Savage <asavageiv@gmail.com> Co-authored-by: Rafael França <rafael@franca.dev>
This commit is contained in:
parent
bc78b65409
commit
58b9ab894b
1 changed files with 6 additions and 2 deletions
|
@ -580,8 +580,9 @@ def initialize!(group = :default) #:nodoc:
|
|||
end
|
||||
```
|
||||
|
||||
As you can see, you can only initialize an app once. The initializers are run through
|
||||
the `run_initializers` method which is defined in `railties/lib/rails/initializable.rb`:
|
||||
You can only initialize an app once. The Railtie [initializers](configuring.html#initializers)
|
||||
are run through the `run_initializers` method which is defined in
|
||||
`railties/lib/rails/initializable.rb`:
|
||||
|
||||
```ruby
|
||||
def run_initializers(group = :default, *args)
|
||||
|
@ -606,6 +607,9 @@ initializers (like building the middleware stack) are run last. The `railtie`
|
|||
initializers are the initializers which have been defined on the `Rails::Application`
|
||||
itself and are run between the `bootstrap` and `finishers`.
|
||||
|
||||
*Note:* Do not confuse Railtie initializers overall with the [load_config_initializers](configuring.html#using-initializer-files)
|
||||
initializer instance or its associated config initializers in `config/initializers`.
|
||||
|
||||
After this is done we go back to `Rack::Server`.
|
||||
|
||||
### Rack: lib/rack/server.rb
|
||||
|
|
Loading…
Reference in a new issue