diff options
author | Xavier Noria <fxn@hashref.com> | 2015-02-18 12:33:05 +0100 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2015-02-18 12:37:19 +0100 |
commit | 9814eb64275973abc66b1481b522c39b7083fff5 (patch) | |
tree | 6a1604d71aa1763400709278bfdc015bb83c311c | |
parent | 07b659ca3f6945b5032690f38fdd0e080b842d37 (diff) | |
download | rails-9814eb64275973abc66b1481b522c39b7083fff5.tar.gz rails-9814eb64275973abc66b1481b522c39b7083fff5.tar.bz2 rails-9814eb64275973abc66b1481b522c39b7083fff5.zip |
constants guide: adds a step to a resolution algorithm
Not sure how this one slipped, maybe deleted by accident while editing or
something. Anyway, fixed.
-rw-r--r-- | guides/source/autoloading_and_reloading_constants.md | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/guides/source/autoloading_and_reloading_constants.md b/guides/source/autoloading_and_reloading_constants.md index 8f9125f311..9e78eebf82 100644 --- a/guides/source/autoloading_and_reloading_constants.md +++ b/guides/source/autoloading_and_reloading_constants.md @@ -301,7 +301,9 @@ order. The ancestors of those elements are ignored. 2. If not found, then the algorithm walks up the ancestor chain of the cref. -3. If not found, `const_missing` is invoked on the cref. The default +3. If not found and the cref is a module, the constant is looked up in `Object`. + +4. If not found, `const_missing` is invoked on the cref. The default implementation of `const_missing` raises `NameError`, but it can be overridden. Rails autoloading **does not emulate this algorithm**, but its starting point is |