From d82f73ecabe71fc3814eff0bd26f4f431f690266 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Tue, 30 Nov 2004 18:52:20 +0000 Subject: Abolished ActionController::Base.require_or_load in favor of require_dependency and ActiveRecord::Base.require_or_load in favor of require_association. Both methods are now also available in the global namespace when you need to require dependencies or associations outside of whats done automatically. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@32 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- railties/environments/shared.rb | 2 +- railties/environments/shared_for_gem.rb | 2 +- railties/lib/dispatcher.rb | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'railties') diff --git a/railties/environments/shared.rb b/railties/environments/shared.rb index 0e30f1368b..f47586ebcc 100644 --- a/railties/environments/shared.rb +++ b/railties/environments/shared.rb @@ -35,7 +35,7 @@ require 'action_mailer' # Environment-specific configuration. -ActionController::Base.require_or_load "environments/#{RAILS_ENV}" +require_dependency "environments/#{RAILS_ENV}" ActiveRecord::Base.configurations = YAML::load(File.open("#{RAILS_ROOT}/config/database.yml")) ActiveRecord::Base.establish_connection diff --git a/railties/environments/shared_for_gem.rb b/railties/environments/shared_for_gem.rb index 0316522258..c8aa36a505 100644 --- a/railties/environments/shared_for_gem.rb +++ b/railties/environments/shared_for_gem.rb @@ -32,7 +32,7 @@ require_gem 'rails' # Environment-specific configuration. -ActionController::Base.require_or_load "environments/#{RAILS_ENV}" +require_dependency "environments/#{RAILS_ENV}" ActiveRecord::Base.configurations = YAML::load(File.open("#{RAILS_ROOT}/config/database.yml")) ActiveRecord::Base.establish_connection diff --git a/railties/lib/dispatcher.rb b/railties/lib/dispatcher.rb index c765a79443..4130f009f8 100644 --- a/railties/lib/dispatcher.rb +++ b/railties/lib/dispatcher.rb @@ -31,8 +31,8 @@ class Dispatcher controller_name, module_name = controller_name(request.parameters), module_name(request.parameters) - ActionController::Base.require_or_load("abstract_application") - ActionController::Base.require_or_load(controller_path(controller_name, module_name)) + require_dependency("abstract_application") + require_dependency(controller_path(controller_name, module_name)) controller_class(controller_name).process(request, response).out rescue Object => e -- cgit v1.2.3