Changeset 5023
- Timestamp:
- 09/05/06 22:36:28 (2 years ago)
- Files:
-
- trunk/activesupport/CHANGELOG (modified) (1 diff)
- trunk/activesupport/lib/active_support/dependencies.rb (modified) (1 diff)
- trunk/activesupport/test/dependencies_test.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/activesupport/CHANGELOG
r4910 r5023 1 1 *SVN* 2 3 * Equate Kernel.const_missing with Object.const_missing. Fixes #5988. [Nicholas Seckar] 2 4 3 5 * Add ApplicationController special case to Dependencies. [Nicholas Seckar] trunk/activesupport/lib/active_support/dependencies.rb
r4910 r5023 207 207 def load_missing_constant(from_mod, const_name) 208 208 log_call from_mod, const_name 209 if from_mod == Kernel 210 if ::Object.const_defined?(const_name) 211 log "Returning Object::#{const_name} for Kernel::#{const_name}" 212 return ::Object.const_get(const_name) 213 else 214 log "Substituting Object for Kernel" 215 from_mod = Object 216 end 217 end 209 218 210 219 # If we have an anonymous module, all we can do is attempt to load from Object. trunk/activesupport/test/dependencies_test.rb
r4910 r5023 421 421 end 422 422 423 def test_const_missing_on_kernel_should_fallback_to_object 424 with_loading 'autoloading_fixtures' do 425 kls = Kernel::E 426 assert_equal "E", kls.name 427 assert_equal kls.object_id, Kernel::E.object_id 428 end 429 end 430 423 431 end