Move cleanup before prepare_dispatch so that constants are not loaded twice [#1898 state:resolved]

Signed-off-by: Joshua Peek <josh@joshpeek.com>
This commit is contained in:
Andrew White 2009-02-07 11:41:00 -06:00 committed by Joshua Peek
parent 50f51ff950
commit 5f5d2d30a0
1 changed files with 5 additions and 6 deletions

View File

@ -88,16 +88,15 @@ module ActionController
end
def reload_application
# Cleanup the application before processing the current request.
ActiveRecord::Base.reset_subclasses if defined?(ActiveRecord)
ActiveSupport::Dependencies.clear
ActiveRecord::Base.clear_reloadable_connections! if defined?(ActiveRecord)
# Run prepare callbacks before every request in development mode
run_callbacks :prepare_dispatch
Routing::Routes.reload
# Cleanup the application by clearing out loaded classes so they can
# be reloaded on the next request without restarting the server.
ActiveRecord::Base.reset_subclasses if defined?(ActiveRecord)
ActiveSupport::Dependencies.clear
ActiveRecord::Base.clear_reloadable_connections! if defined?(ActiveRecord)
end
def flush_logger