diff options
author | peeyush <peeyush@fizzysoftware.com> | 2014-05-22 23:07:18 +0530 |
---|---|---|
committer | peeyush <peeyush@fizzysoftware.com> | 2014-05-23 08:13:55 +0530 |
commit | 42c55b93804d4cd3ff669591ab883f4e672b655c (patch) | |
tree | 6c8942b5ffdc9e705efdb36bb9350fda07557dbf /guides/source | |
parent | 9ca4839a1aa369d934f08c9307196db3e19e9592 (diff) | |
download | rails-42c55b93804d4cd3ff669591ab883f4e672b655c.tar.gz rails-42c55b93804d4cd3ff669591ab883f4e672b655c.tar.bz2 rails-42c55b93804d4cd3ff669591ab883f4e672b655c.zip |
resolved reorder issue in rails active record guide
Diffstat (limited to 'guides/source')
-rw-r--r-- | guides/source/active_record_querying.md | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/guides/source/active_record_querying.md b/guides/source/active_record_querying.md index 4b3d95a3e1..697ddd70cb 100644 --- a/guides/source/active_record_querying.md +++ b/guides/source/active_record_querying.md @@ -753,13 +753,15 @@ Article.find(10).comments.reorder('name') The SQL that would be executed: ```sql -SELECT * FROM articles WHERE id = 10 ORDER BY name +SELECT * FROM articles WHERE id = 10 +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 articles WHERE id = 10 ORDER BY posted_at DESC +SELECT * FROM articles WHERE id = 10 +SELECT * FROM comments WHERE article_id = 10 ORDER BY posted_at DESC ``` ### `reverse_order` |