From 9814eb64275973abc66b1481b522c39b7083fff5 Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Wed, 18 Feb 2015 12:33:05 +0100 Subject: 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. --- guides/source/autoloading_and_reloading_constants.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'guides/source/autoloading_and_reloading_constants.md') 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 -- cgit v1.2.3