aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/dependencies.rb
diff options
context:
space:
mode:
authorNicholas Seckar <nseckar@gmail.com>2006-09-05 22:36:28 +0000
committerNicholas Seckar <nseckar@gmail.com>2006-09-05 22:36:28 +0000
commit1d554b84f8b669a2be281845a3989b8d0c40b359 (patch)
tree90c10f269487f9379717f055e3b7018d5f08bd75 /activesupport/lib/active_support/dependencies.rb
parentbd09d9aafb56912ba384a20ac3dfd7bfd7a784e4 (diff)
downloadrails-1d554b84f8b669a2be281845a3989b8d0c40b359.tar.gz
rails-1d554b84f8b669a2be281845a3989b8d0c40b359.tar.bz2
rails-1d554b84f8b669a2be281845a3989b8d0c40b359.zip
Equate Kernel.const_missing with Object.const_missing. Fixes #5988.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5023 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/lib/active_support/dependencies.rb')
-rw-r--r--activesupport/lib/active_support/dependencies.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/dependencies.rb b/activesupport/lib/active_support/dependencies.rb
index 39244b23be..bccbd549b1 100644
--- a/activesupport/lib/active_support/dependencies.rb
+++ b/activesupport/lib/active_support/dependencies.rb
@@ -206,6 +206,15 @@ module Dependencies #:nodoc:
# using const_missing.
def load_missing_constant(from_mod, const_name)
log_call from_mod, const_name
+ if from_mod == Kernel
+ if ::Object.const_defined?(const_name)
+ log "Returning Object::#{const_name} for Kernel::#{const_name}"
+ return ::Object.const_get(const_name)
+ else
+ log "Substituting Object for Kernel"
+ from_mod = Object
+ end
+ end
# If we have an anonymous module, all we can do is attempt to load from Object.
from_mod = Object if from_mod.name.empty?