diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-05-21 15:30:38 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-05-21 15:30:38 -0300 |
commit | 465736bf85cc24e1d94b3a476cbced4963fa4351 (patch) | |
tree | 69f3ec6f012d5862af1d3fc6440ed5c040ff1eb3 | |
parent | 5335f4c0800be5aae0dee997168b339cb4b406b6 (diff) | |
parent | 18c5f4ef9db4ee1da52f76fe0934f2e5eea287a8 (diff) | |
download | rails-465736bf85cc24e1d94b3a476cbced4963fa4351.tar.gz rails-465736bf85cc24e1d94b3a476cbced4963fa4351.tar.bz2 rails-465736bf85cc24e1d94b3a476cbced4963fa4351.zip |
Merge pull request #15229 from peeyushsingla/master
fixes in active record query for reorder in rails guides
-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` |