From ee014ef95ae9746b4228f3bc7c85ac0df28ba1df Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 16 Jan 2005 17:50:36 +0000 Subject: New adventures in dependency reloading git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@429 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- railties/lib/dispatcher.rb | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) (limited to 'railties/lib') diff --git a/railties/lib/dispatcher.rb b/railties/lib/dispatcher.rb index 81c1ed9cb3..05cbab4265 100644 --- a/railties/lib/dispatcher.rb +++ b/railties/lib/dispatcher.rb @@ -24,13 +24,11 @@ require 'breakpoint' class Dispatcher - class < exception ActionController::Base.process_with_exception(request, response, exception).out - ensure - remove_class_hierarchy(controller_class(controller_name), ActionController::Base) if Dependencies.mechanism == :load + ensure + reset_application(controller_name) if Dependencies.mechanism == :load Breakpoint.deactivate_drb if defined?(BREAKPOINT_SERVER_PORT) end end private - - def reload_application - if Dependencies.mechanism == :load - ActiveRecord::Base.reset_column_information_and_inheritable_attributes_for_all_subclasses - Dependencies.reload - end + def reset_application(controller_name) + ActiveRecord::Base.reset_column_information_and_inheritable_attributes_for_all_subclasses + Dependencies.clear + remove_class_hierarchy(controller_class(controller_name), ApplicationController) end def controller_path(controller_name, module_name = nil) -- cgit v1.2.3