Skip to content

Commit

Permalink
Merge branch 'patch-8' of https://github.com/jonatack/rails into jona…
Browse files Browse the repository at this point in the history
…tack-patch-8

[ci skip]

Conflicts:
	guides/source/constant_autoloading_and_reloading.md
  • Loading branch information
Zachary Scott committed Dec 16, 2014
2 parents fb390df + 401b4aa commit 8365943
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions guides/source/constant_autoloading_and_reloading.md
Expand Up @@ -7,14 +7,16 @@ After reading this guide, you will know:

* Key aspects of Ruby constants

* What is `autoload_paths`
* The purpose of `autoload_paths`

* How constant autoloading works

* What is `require_dependency`

* How constant reloading works

* Why autoloading is not based on `Module#autoload`

* Solutions to common autoloading gotchas

--------------------------------------------------------------------------------
Expand Down Expand Up @@ -225,13 +227,13 @@ constants on the fly.
### Constants are Stored in Modules

Constants belong to modules in a very literal sense. Classes and modules have
a constant table, think of it as a hash table.
a constant table; think of it as a hash table.

Let's analyze an example to really understand what that means. While in a
casual setting some abuses of language are customary, the exposition is going
to be exact here for didactic purposes.
Let's analyze an example to really understand what that means. While figurative
language may be customary in a casual setting, for didactic purposes we will
be literal and precise.

This comment has been minimized.

Copy link
@fxn

fxn Dec 16, 2014

Member

Hey thanks for this patch. I have undone some of the edits because I don't think all of them improve the text.

In particular "the String class" is an abuse of language rather than figurative language, and you use that expression when you're being casual or informal. Abuse of language means "a use of terminology in a way that is not formally correct but that simplifies exposition or suggests the correct intuition".


Let's consider the following module definition:
Consider the following module definition:

```ruby
module Colors
Expand Down Expand Up @@ -648,7 +650,7 @@ trigger the heuristic is defined in the conflicting place.
When a module acts as a namespace, Rails does not require the application to
defines a file for it, a directory matching the namespace is enough.

Suppose an application has a backoffice whose controllers are stored in
Suppose an application has a back office whose controllers are stored in
`app/controllers/admin`. If the `Admin` module is not yet loaded when
`Admin::UsersController` is hit, Rails needs first to autoload the constant
`Admin`.
Expand Down

0 comments on commit 8365943

Please sign in to comment.