diff options
Diffstat (limited to 'actionpack/lib/action_dispatch/railtie.rb')
-rw-r--r-- | actionpack/lib/action_dispatch/railtie.rb | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/actionpack/lib/action_dispatch/railtie.rb b/actionpack/lib/action_dispatch/railtie.rb index e4bd143e78..bd15ca9b3b 100644 --- a/actionpack/lib/action_dispatch/railtie.rb +++ b/actionpack/lib/action_dispatch/railtie.rb @@ -5,22 +5,14 @@ module ActionDispatch class Railtie < Rails::Railtie plugin_name :action_dispatch + # Initialize route files to an array + config.action_dispatch.route_files = [] + # Prepare dispatcher callbacks and run 'prepare' callbacks initializer "action_dispatch.prepare_dispatcher" do |app| # TODO: This used to say unless defined?(Dispatcher). Find out why and fix. require 'rails/dispatcher' - - unless app.config.cache_classes - # Setup dev mode route reloading - routes_last_modified = app.routes_changed_at - reload_routes = lambda do - unless app.routes_changed_at == routes_last_modified - routes_last_modified = app.routes_changed_at - app.reload_routes! - end - end - ActionDispatch::Callbacks.before { |callbacks| reload_routes.call } - end + ActionDispatch::Callbacks.to_prepare { app.routes_reloader.reload_if_changed } end end end
\ No newline at end of file |