diff options
author | Xavier Noria <fxn@hashref.com> | 2014-12-16 16:39:20 +0100 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2014-12-16 16:39:20 +0100 |
commit | ab90c277a74b4b47a8d4cbef796c45d1a8b17cfd (patch) | |
tree | 5f6520366157107618e2906d323add4af9c35562 | |
parent | e12be48774e174be3e79b0108073efdc418956b5 (diff) | |
parent | 3aebff160d10770f828e485f020e1a84d8835d94 (diff) | |
download | rails-ab90c277a74b4b47a8d4cbef796c45d1a8b17cfd.tar.gz rails-ab90c277a74b4b47a8d4cbef796c45d1a8b17cfd.tar.bz2 rails-ab90c277a74b4b47a8d4cbef796c45d1a8b17cfd.zip |
Merge pull request #18050 from jonatack/patch-13
Improve section in constant autoload guide
-rw-r--r-- | guides/source/constant_autoloading_and_reloading.md | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/guides/source/constant_autoloading_and_reloading.md b/guides/source/constant_autoloading_and_reloading.md index effa66f19c..5f435ddbd8 100644 --- a/guides/source/constant_autoloading_and_reloading.md +++ b/guides/source/constant_autoloading_and_reloading.md @@ -627,17 +627,17 @@ been triggered in the first place. Thus, Rails assumes a qualified reference and considers the file `admin/user.rb` and directory `admin/user` to be the only valid options. -In practice this works quite well as long as the nesting matches all parent +In practice, this works quite well as long as the nesting matches all parent namespaces respectively and the constants that make the rule apply are known at that time. -But since autoloading happens on demand, if the top-level `User` by chance was -not yet loaded then Rails has no way to know whether `Admin::User` should load it -or raise `NameError`. +However, autoloading happens on demand. If by chance the top-level `User` was +not yet loaded, then Rails has no way to know whether `Admin::User` should load +it or raise `NameError`. -These kind of name conflicts are rare in practice but, in case there's one, -`require_dependency` provides a solution by making sure the constant needed to -trigger the heuristic is defined in the conflicting place. +Naming conflicts of this kind are rare in practice, but if one occurs, +`require_dependency` provides a solution by ensuring that the constant needed +to trigger the heuristic is defined in the conflicting place. ### Automatic Modules |