rails/rails — pull request #15260 by JohnKellyFerguson (2014-05-23 02:41:38+00:00)
Title: Guides: Fix Incorrect Reference to Article in example SQL query

I incorrectly replaced `comment` with `article` in two of the SQL queries that were part of #15215.

This is how it should appear.

> ### `reorder`

> The `reorder` method overrides the default scope order. For example:

> ```ruby
class Article < ActiveRecord::Base
..
..
has_many :comments, -> { order('posted_at DESC') }
end

> Article.find(10).comments.reorder('name')
```

> The SQL that would be executed:

> ```sql
SELECT * FROM comments WHERE article_id = 10 ORDER BY name
```

> In case the `reorder` clause is not used, the SQL executed would be:

> ```sql
SELECT * FROM comments WHERE article_id = 10 ORDER BY posted_at DESC
```

Currently, the sql clauses in the above appear as:

```sql
SELECT * FROM articles WHERE id = 10 ORDER BY name
```

```sql
SELECT * FROM articles WHERE id = 10 ORDER BY posted_at DESC
```

This resolves that issues as well as fixes the alignment for some of the tables.