diff options
author | Andrew White <andyw@pixeltrix.co.uk> | 2009-02-07 11:41:00 -0600 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-02-07 11:41:00 -0600 |
commit | 5f5d2d30a0c02d15b37f8f07db1b0abe9c7309f4 (patch) | |
tree | bfdb78490b18bbac4380ab84652699876768fa38 /actionpack/lib | |
parent | 50f51ff95047858fa6dd889ade3027b7254c6dc0 (diff) | |
download | rails-5f5d2d30a0c02d15b37f8f07db1b0abe9c7309f4.tar.gz rails-5f5d2d30a0c02d15b37f8f07db1b0abe9c7309f4.tar.bz2 rails-5f5d2d30a0c02d15b37f8f07db1b0abe9c7309f4.zip |
Move cleanup before prepare_dispatch so that constants are not loaded twice [#1898 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_controller/dispatcher.rb | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/actionpack/lib/action_controller/dispatcher.rb b/actionpack/lib/action_controller/dispatcher.rb index 9374a7f060..e91babde10 100644 --- a/actionpack/lib/action_controller/dispatcher.rb +++ b/actionpack/lib/action_controller/dispatcher.rb @@ -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 |