Skip to content

Commit

Permalink
Merge pull request #15229 from peeyushsingla/master
Browse files Browse the repository at this point in the history
fixes in active record query for reorder in rails guides
  • Loading branch information
rafaelfranca committed May 21, 2014
2 parents 5335f4c + 18c5f4e commit 465736b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions guides/source/active_record_querying.md
Original file line number Diff line number Diff line change
Expand Up @@ -753,13 +753,13 @@ Post.find(10).comments.reorder('name')
The SQL that would be executed:

```sql
SELECT * FROM posts WHERE id = 10 ORDER BY name
SELECT * FROM comments WHERE post_id = 10 ORDER BY name
```

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

```sql
SELECT * FROM posts WHERE id = 10 ORDER BY posted_at DESC
SELECT * FROM comments WHERE post_id = 10 ORDER BY posted_at DESC
```

### `reverse_order`
Expand Down

0 comments on commit 465736b

Please sign in to comment.