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 --- actionpack/lib/action_controller/base.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'actionpack/lib/action_controller/base.rb') diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb index 22eb7dc0a3..1f4798b2a0 100755 --- a/actionpack/lib/action_controller/base.rb +++ b/actionpack/lib/action_controller/base.rb @@ -256,9 +256,11 @@ module ActionController #:nodoc: end # Loads the file_name if reload_dependencies is true or requires if it's false. - def require_or_load(file_name) + def require_dependency(file_name) reload_dependencies ? silence_warnings { load("#{file_name}.rb") } : require(file_name) end + + Object.send(:define_method, :require_dependency) { |file_name| ActiveRecord::Base.require_dependency(file_name) } end public -- cgit v1.2.3