aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib')
-rw-r--r--railties/lib/console_app.rb4
-rw-r--r--railties/lib/initializer.rb9
2 files changed, 11 insertions, 2 deletions
diff --git a/railties/lib/console_app.rb b/railties/lib/console_app.rb
index c7673642ec..88e7962b43 100644
--- a/railties/lib/console_app.rb
+++ b/railties/lib/console_app.rb
@@ -24,7 +24,7 @@ end
def reload!
puts "Reloading..."
dispatcher = ActionController::Dispatcher.new($stdout)
- dispatcher.cleanup_application(true)
- dispatcher.prepare_application(true)
+ dispatcher.cleanup_application
+ dispatcher.reload_application
true
end
diff --git a/railties/lib/initializer.rb b/railties/lib/initializer.rb
index 18af73fc89..b5bf9266f5 100644
--- a/railties/lib/initializer.rb
+++ b/railties/lib/initializer.rb
@@ -135,6 +135,9 @@ module Rails
load_application_initializers
+ # Prepare dispatcher callbacks and run 'prepare' callbacks
+ prepare_dispatcher
+
# the framework is now fully initialized
after_initialize
@@ -442,6 +445,12 @@ module Rails
end
end
+ def prepare_dispatcher
+ require 'dispatcher' unless defined?(::Dispatcher)
+ Dispatcher.define_dispatcher_callbacks(configuration.cache_classes)
+ Dispatcher.new(RAILS_DEFAULT_LOGGER).send :run_callbacks, :prepare_dispatch
+ end
+
end
# The Configuration class holds all the parameters for the Initializer and