diff options
author | Vijay Dev <vijaydev.cse@gmail.com> | 2011-04-06 15:14:47 +0530 |
---|---|---|
committer | Vijay Dev <vijaydev.cse@gmail.com> | 2011-04-06 15:14:47 +0530 |
commit | e836fc1bd2f3df0b8b0a2ef5deb182bcf1f0f3c2 (patch) | |
tree | 39a1b935b6fac4484ec9f74cc65543e7040ef169 | |
parent | c327ef4d65650743fbf49c8ba29016ecef70dd39 (diff) | |
download | rails-e836fc1bd2f3df0b8b0a2ef5deb182bcf1f0f3c2.tar.gz rails-e836fc1bd2f3df0b8b0a2ef5deb182bcf1f0f3c2.tar.bz2 rails-e836fc1bd2f3df0b8b0a2ef5deb182bcf1f0f3c2.zip |
fix example query
-rw-r--r-- | railties/guides/source/active_record_querying.textile | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/railties/guides/source/active_record_querying.textile b/railties/guides/source/active_record_querying.textile index f3a10b8b92..df8e35ed33 100644 --- a/railties/guides/source/active_record_querying.textile +++ b/railties/guides/source/active_record_querying.textile @@ -790,7 +790,7 @@ Post.includes(:comments).where("comments.visible", true) This would generate a query which contains a +LEFT OUTER JOIN+ whereas the +joins+ method would generate one using the +INNER JOIN+ function instead. <ruby> - SELECT "posts"."id" AS t0_r0, ... "comments"."updated_at" AS t1_r5 FROM "posts" LEFT OUTER JOIN "comments" ON "comments"."post_id" = "posts"."id" WHERE (comments.visible) + SELECT "posts"."id" AS t0_r0, ... "comments"."updated_at" AS t1_r5 FROM "posts" LEFT OUTER JOIN "comments" ON "comments"."post_id" = "posts"."id" WHERE (comments.visible = 1) </ruby> If there was no +where+ condition, this would generate the normal set of two queries. |