diff options
Diffstat (limited to 'railties/lib/rails/application')
-rw-r--r-- | railties/lib/rails/application/bootstrap.rb | 8 | ||||
-rw-r--r-- | railties/lib/rails/application/configuration.rb | 25 | ||||
-rw-r--r-- | railties/lib/rails/application/finisher.rb | 8 |
3 files changed, 23 insertions, 18 deletions
diff --git a/railties/lib/rails/application/bootstrap.rb b/railties/lib/rails/application/bootstrap.rb index 213aa0768a..9c9d85eed6 100644 --- a/railties/lib/rails/application/bootstrap.rb +++ b/railties/lib/rails/application/bootstrap.rb @@ -51,11 +51,9 @@ module Rails end initializer :set_clear_dependencies_hook do - unless config.cache_classes - ActionDispatch::Callbacks.after do - ActiveSupport::DescendantsTracker.clear - ActiveSupport::Dependencies.clear - end + ActionDispatch::Reloader.to_cleanup do + ActiveSupport::DescendantsTracker.clear + ActiveSupport::Dependencies.clear end end diff --git a/railties/lib/rails/application/configuration.rb b/railties/lib/rails/application/configuration.rb index 8cd496781b..c74bcbedf2 100644 --- a/railties/lib/rails/application/configuration.rb +++ b/railties/lib/rails/application/configuration.rb @@ -6,25 +6,28 @@ module Rails class Configuration < ::Rails::Engine::Configuration attr_accessor :allow_concurrency, :asset_host, :cache_classes, :cache_store, :encoding, :consider_all_requests_local, :dependency_loading, - :filter_parameters, :helpers_paths, :log_level, :logger, + :filter_parameters, :helpers_paths, :logger, :preload_frameworks, :reload_plugins, :secret_token, :serve_static_assets, :session_options, :time_zone, :whiny_nils + attr_writer :log_level + def initialize(*) super self.encoding = "utf-8" - @allow_concurrency = false + @allow_concurrency = false @consider_all_requests_local = false - @filter_parameters = [] - @helpers_paths = [] - @dependency_loading = true - @serve_static_assets = true - @session_store = :cookie_store - @session_options = {} - @time_zone = "UTC" - @middleware = app_middleware - @generators = app_generators + @filter_parameters = [] + @helpers_paths = [] + @dependency_loading = true + @serve_static_assets = true + @session_store = :cookie_store + @session_options = {} + @time_zone = "UTC" + @log_level = nil + @middleware = app_middleware + @generators = app_generators end def compiled_asset_path diff --git a/railties/lib/rails/application/finisher.rb b/railties/lib/rails/application/finisher.rb index e3342be7ee..a45b61c99c 100644 --- a/railties/lib/rails/application/finisher.rb +++ b/railties/lib/rails/application/finisher.rb @@ -21,7 +21,7 @@ module Rails initializer :add_to_prepare_blocks do config.to_prepare_blocks.each do |block| - ActionDispatch::Callbacks.to_prepare(&block) + ActionDispatch::Reloader.to_prepare(&block) end end @@ -37,6 +37,10 @@ module Rails build_middleware_stack end + initializer :run_prepare_callbacks do + ActionDispatch::Reloader.prepare! + end + initializer :eager_load! do if config.cache_classes && !$rails_rake_task ActiveSupport.run_load_hooks(:before_eager_load, self) @@ -52,7 +56,7 @@ module Rails initializer :set_routes_reloader do |app| reloader = lambda { app.routes_reloader.execute_if_updated } reloader.call - ActionDispatch::Callbacks.to_prepare(&reloader) + ActionDispatch::Reloader.to_prepare(&reloader) end # Disable dependency loading during request cycle |