Skip to content

Commit

Permalink
Move cleanup before prepare_dispatch so that constants are not loaded…
Browse files Browse the repository at this point in the history
… twice [#1898 state:resolved]

Signed-off-by: Joshua Peek <josh@joshpeek.com>
  • Loading branch information
pixeltrix authored and josh committed Feb 7, 2009
1 parent 50f51ff commit 5f5d2d3
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions actionpack/lib/action_controller/dispatcher.rb
Expand Up @@ -88,16 +88,15 @@ def _call(env)
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
Expand Down

0 comments on commit 5f5d2d3

Please sign in to comment.