aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support
diff options
context:
space:
mode:
authorSimon Coffey <simon@tribesports.com>2013-07-26 17:37:00 +0100
committerSimon Coffey <simon@tribesports.com>2013-08-27 08:20:33 +0100
commitb4a96686267c8bb261eca21c02acab9fd5f7ca96 (patch)
treea4272b7b2414f1986d82d37c5ac0593e12035f50 /activesupport/lib/active_support
parent701664b56b69827bfb46a5acfddf81d3a81b5d09 (diff)
downloadrails-b4a96686267c8bb261eca21c02acab9fd5f7ca96.tar.gz
rails-b4a96686267c8bb261eca21c02acab9fd5f7ca96.tar.bz2
rails-b4a96686267c8bb261eca21c02acab9fd5f7ca96.zip
Ensure all-caps nested consts marked as autoloaded
Previously, an autoloaded constant `HTML::SomeClass` would not be marked as autoloaded by AS::Dependencies. This is because the `#loadable_constants_for_path` method uses `String#camelize` on the inferred file path, which in turn means that, unless otherwise directed, AS::Dependencies watches for loaded constants in the `Html` namespace. By passing the original qualified constant name to `#load_or_require`, this inference step is avoided, and the new constant is picked up in the correct namespace.
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r--activesupport/lib/active_support/dependencies.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/dependencies.rb b/activesupport/lib/active_support/dependencies.rb
index 73559bfe0e..db9f5d4baa 100644
--- a/activesupport/lib/active_support/dependencies.rb
+++ b/activesupport/lib/active_support/dependencies.rb
@@ -459,7 +459,7 @@ module ActiveSupport #:nodoc:
if loaded.include?(expanded)
raise "Circular dependency detected while autoloading constant #{qualified_name}"
else
- require_or_load(expanded)
+ require_or_load(expanded, qualified_name)
raise LoadError, "Unable to autoload constant #{qualified_name}, expected #{file_path} to define it" unless from_mod.const_defined?(const_name, false)
return from_mod.const_get(const_name)
end