Skip to content

Commit

Permalink
Merge pull request #31602 from eugeneius/config_eager_load
Browse files Browse the repository at this point in the history
Clarify that config.eager_load controls eager loading [ci skip]
  • Loading branch information
kamipo committed Dec 31, 2017
2 parents 7fae88f + fdd76b7 commit 71b4bf6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions guides/source/engines.md
Original file line number Diff line number Diff line change
Expand Up @@ -1516,12 +1516,12 @@ To hook into the initialization process of one of the following classes use the

These are the available configuration hooks. They do not hook into any particular framework, but instead they run in context of the entire application.

| Hook | Use Case |
| ---------------------- | ------------------------------------------------------------------------------------- |
| `before_configuration` | First configurable block to run. Called before any initializers are run. |
| `before_initialize` | Second configurable block to run. Called before frameworks initialize. |
| `before_eager_load` | Third configurable block to run. Does not run if `config.cache_classes` set to false. |
| `after_initialize` | Last configurable block to run. Called after frameworks initialize. |
| Hook | Use Case |
| ---------------------- | ---------------------------------------------------------------------------------- |
| `before_configuration` | First configurable block to run. Called before any initializers are run. |
| `before_initialize` | Second configurable block to run. Called before frameworks initialize. |
| `before_eager_load` | Third configurable block to run. Does not run if `config.eager_load` set to false. |
| `after_initialize` | Last configurable block to run. Called after frameworks initialize. |

### Example

Expand Down
2 changes: 1 addition & 1 deletion railties/lib/rails/application/finisher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ module Finisher
end

# This needs to happen before eager load so it happens
# in exactly the same point regardless of config.cache_classes
# in exactly the same point regardless of config.eager_load
initializer :run_prepare_callbacks do |app|
app.reloader.prepare!
end
Expand Down
2 changes: 1 addition & 1 deletion railties/lib/rails/railtie/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def before_configuration(&block)
ActiveSupport.on_load(:before_configuration, yield: true, &block)
end

# Third configurable block to run. Does not run if +config.cache_classes+
# Third configurable block to run. Does not run if +config.eager_load+
# set to false.
def before_eager_load(&block)
ActiveSupport.on_load(:before_eager_load, yield: true, &block)
Expand Down

0 comments on commit 71b4bf6

Please sign in to comment.