mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
fixes in active record query for reorder
This commit is contained in:
parent
b042f21c93
commit
18c5f4ef9d
1 changed files with 2 additions and 2 deletions
|
@ -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`
|
||||
|
|
Loading…
Reference in a new issue