diff options
author | Xavier Noria <fxn@hashref.com> | 2019-02-20 14:23:57 -0800 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2019-02-20 14:24:26 -0800 |
commit | 2420c44d4b1dfbffea7b624cb8a8c68beb05936f (patch) | |
tree | 873489879d4a2ce8e661af686efda5ddb0a87082 /railties/lib/rails | |
parent | 0f70b025839f4df9267de0d5a7fb23d4db1a0c83 (diff) | |
download | rails-2420c44d4b1dfbffea7b624cb8a8c68beb05936f.tar.gz rails-2420c44d4b1dfbffea7b624cb8a8c68beb05936f.tar.bz2 rails-2420c44d4b1dfbffea7b624cb8a8c68beb05936f.zip |
Explains a detail re eager loading [ci skip]
Diffstat (limited to 'railties/lib/rails')
-rw-r--r-- | railties/lib/rails/application/finisher.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/railties/lib/rails/application/finisher.rb b/railties/lib/rails/application/finisher.rb index 39e8ef6631..8d2c13d2a8 100644 --- a/railties/lib/rails/application/finisher.rb +++ b/railties/lib/rails/application/finisher.rb @@ -73,6 +73,9 @@ module Rails initializer :eager_load! do if config.eager_load ActiveSupport.run_load_hooks(:before_eager_load, self) + # Checks defined?(Zeitwerk) instead of zeitwerk_enabled? because we + # want to eager load any dependency managed by Zeitwerk regardless of + # the autoloading mode of the application. Zeitwerk::Loader.eager_load_all if defined?(Zeitwerk) config.eager_load_namespaces.each(&:eager_load!) end |