diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2004-12-29 21:26:20 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2004-12-29 21:26:20 +0000 |
commit | fa1f5e062ec621238b0a36c6093329429d2a218b (patch) | |
tree | 5eecb8b3679dc0fa90c356eafc8224489672c3ec /railties | |
parent | 595a4a591b6f4f863d52e28046e2fc1c51dfcad5 (diff) | |
download | rails-fa1f5e062ec621238b0a36c6093329429d2a218b.tar.gz rails-fa1f5e062ec621238b0a36c6093329429d2a218b.tar.bz2 rails-fa1f5e062ec621238b0a36c6093329429d2a218b.zip |
Switch dispatcher to use the new shared Dependencies approach
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@280 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties')
-rw-r--r-- | railties/environments/development.rb | 4 | ||||
-rw-r--r-- | railties/environments/production.rb | 3 | ||||
-rw-r--r-- | railties/environments/test.rb | 3 | ||||
-rw-r--r-- | railties/lib/dispatcher.rb | 4 |
4 files changed, 5 insertions, 9 deletions
diff --git a/railties/environments/development.rb b/railties/environments/development.rb index b8d4600759..42a43d59fb 100644 --- a/railties/environments/development.rb +++ b/railties/environments/development.rb @@ -1,5 +1,3 @@ +Dependencies.mechanism = :load ActionController::Base.consider_all_requests_local = true -ActionController::Base.reload_dependencies = true -ActiveRecord::Base.reload_associations = true - BREAKPOINT_SERVER_PORT = 42531
\ No newline at end of file diff --git a/railties/environments/production.rb b/railties/environments/production.rb index 8e50475899..2069ebcf15 100644 --- a/railties/environments/production.rb +++ b/railties/environments/production.rb @@ -1,3 +1,2 @@ +Dependencies.mechanism = :require ActionController::Base.consider_all_requests_local = false -ActionController::Base.reload_dependencies = false -ActiveRecord::Base.reload_associations = false diff --git a/railties/environments/test.rb b/railties/environments/test.rb index c20c260033..d4db0e9c64 100644 --- a/railties/environments/test.rb +++ b/railties/environments/test.rb @@ -1,4 +1,3 @@ +Dependencies.mechanism = :require ActionController::Base.consider_all_requests_local = true -ActionController::Base.reload_dependencies = false -ActiveRecord::Base.reload_associations = false ActionMailer::Base.delivery_method = :test
\ No newline at end of file diff --git a/railties/lib/dispatcher.rb b/railties/lib/dispatcher.rb index e539ab5af8..9cea6ce249 100644 --- a/railties/lib/dispatcher.rb +++ b/railties/lib/dispatcher.rb @@ -40,11 +40,11 @@ class Dispatcher rescue Object => exception ActionController::Base.process_with_exception(request, response, exception).out ensure - if ActionController::Base.reload_dependencies + if Dependencies.mechanism == :load Object.send(:remove_const, "ApplicationController") if Object.const_defined?(:ApplicationController) Object.send(:remove_const, controller_class_name(controller_name)) if Object.const_defined?(controller_class_name(controller_name)) ActiveRecord::Base.reset_column_information_and_inheritable_attributes_for_all_subclasses - ActiveRecord::Base.reload_associations_loaded + Dependencies.reload end Breakpoint.deactivate_drb if defined?(BREAKPOINT_SERVER_PORT) |