diff options
author | peeyush <peeyush@fizzysoftware.com> | 2014-05-21 23:40:19 +0530 |
---|---|---|
committer | peeyush <peeyush@fizzysoftware.com> | 2014-05-21 23:40:19 +0530 |
commit | 18c5f4ef9db4ee1da52f76fe0934f2e5eea287a8 (patch) | |
tree | 9e8ab97efea592e29915ce4507d32724cdfd8b56 /guides/source | |
parent | b042f21c93959e0247d447f37644815bdc6d5851 (diff) | |
download | rails-18c5f4ef9db4ee1da52f76fe0934f2e5eea287a8.tar.gz rails-18c5f4ef9db4ee1da52f76fe0934f2e5eea287a8.tar.bz2 rails-18c5f4ef9db4ee1da52f76fe0934f2e5eea287a8.zip |
fixes in active record query for reorder
Diffstat (limited to 'guides/source')
-rw-r--r-- | guides/source/active_record_querying.md | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/guides/source/active_record_querying.md b/guides/source/active_record_querying.md index 2a76df156c..88ba7f25ca 100644 --- a/guides/source/active_record_querying.md +++ b/guides/source/active_record_querying.md @@ -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` |