aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2004-11-30 19:13:34 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2004-11-30 19:13:34 +0000
commitd6d875bfb4103b6ac777083946bdcfa527d750a8 (patch)
treebed6c0c69d76905a2d15ae5c0a78d1c971ad7292 /actionpack
parentd82f73ecabe71fc3814eff0bd26f4f431f690266 (diff)
downloadrails-d6d875bfb4103b6ac777083946bdcfa527d750a8.tar.gz
rails-d6d875bfb4103b6ac777083946bdcfa527d750a8.tar.bz2
rails-d6d875bfb4103b6ac777083946bdcfa527d750a8.zip
Moved the global require_* out of the classes so they actually work without stack overflows
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@33 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack')
-rwxr-xr-xactionpack/lib/action_controller/base.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb
index 1f4798b2a0..fda7c15174 100755
--- a/actionpack/lib/action_controller/base.rb
+++ b/actionpack/lib/action_controller/base.rb
@@ -5,6 +5,10 @@ require 'action_controller/support/class_attribute_accessors'
require 'action_controller/support/class_inheritable_attributes'
require 'action_controller/support/inflector'
+unless Object.respond_to?(:require_dependency)
+ Object.send(:define_method, :require_dependency) { |file_name| ActionController::Base.require_dependency(file_name) }
+end
+
module ActionController #:nodoc:
class ActionControllerError < StandardError #:nodoc:
end
@@ -259,8 +263,6 @@ module ActionController #:nodoc:
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