rails/rails — pull request #11636 by urbanautomaton (2013-07-28 10:12:28+00:00)
Title: `ActiveSupport::Dependencies`: consts in uppercase nestings not marked as autoloaded

Hi,

I noticed that constants autoloaded in all-caps nestings are not getting marked as such by `ActiveSupport::Dependencies`. As a result they're not reloaded after modification when `cache_classes` is disabled. A failing test case is included.

This was because the originally requested constant name was not being passed to `#load_or_require`, so the expected location of the new constant had to be inferred from the path name using `String#camelize`. So if you autoloaded `HTML::SomeClass`, the watcher was told to look for new constants in `Html`, and none were found.

I've fixed this by passing the qualified constant name to `#load_or_require`. This seemed to be the original intention behind the optional `const_path` argument to that method, which was previously unused.

The full build passes on the rails-dev-box - any feedback would be greatly appreciated. I've left the commits separate for review but will squash them if it's okay to merge.

Cheers,
Simon