Permalink
Browse files

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
  • Loading branch information...
1 parent 595a4a5 commit fa1f5e062ec621238b0a36c6093329429d2a218b @dhh dhh committed Dec 29, 2004
@@ -226,15 +226,6 @@ def self.inherited(child) #:nodoc:
cattr_accessor :default_timezone
@@default_timezone = :local
- # When turned on (which is default), all associations are included using "load". This mean that any change is instant in cached
- # environments like mod_ruby or FastCGI. When set to false, "require" is used, which is faster but requires server restart to
- # reflect changes.
- @@reload_associations = true
- cattr_accessor :reload_associations
-
- @@associations_loaded = []
- cattr_accessor :associations_loaded
-
class << self # Class methods
# Returns objects for the records responding to either a specific id (1), a list of ids (1, 5, 6) or an array of ids.
# If only one ID is specified, that object is returned directly. If more than one ID is specified, an array is returned.
@@ -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
@@ -1,3 +1,2 @@
+Dependencies.mechanism = :require
ActionController::Base.consider_all_requests_local = false
-ActionController::Base.reload_dependencies = false
-ActiveRecord::Base.reload_associations = false
@@ -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
@@ -40,11 +40,11 @@ def self.dispatch(cgi = CGI.new, session_options = ActionController::CgiRequest:
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)

0 comments on commit fa1f5e0

Please sign in to comment.