aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides/source
diff options
context:
space:
mode:
authorRohit Arondekar <rohit.arondekar@gmail.com>2010-06-13 03:05:56 -0700
committerRohit Arondekar <rohit.arondekar@gmail.com>2010-06-13 03:05:56 -0700
commitb7a305f0cb7bf0cebc6f053b9faa45433809ce0d (patch)
treea15ced34200a254539d710446587ccff73ecd1e5 /railties/guides/source
parent27f337d54faa72a4d14f26fbfa5b0a1d5c28d44c (diff)
downloadrails-b7a305f0cb7bf0cebc6f053b9faa45433809ce0d.tar.gz
rails-b7a305f0cb7bf0cebc6f053b9faa45433809ce0d.tar.bz2
rails-b7a305f0cb7bf0cebc6f053b9faa45433809ce0d.zip
Rails Guides: AR Querying, .count should be at the end as it returns a number. [#4811 state:resolved]
Diffstat (limited to 'railties/guides/source')
-rw-r--r--railties/guides/source/active_record_querying.textile2
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 e18dbc9c42..6e7ff6d5e0 100644
--- a/railties/guides/source/active_record_querying.textile
+++ b/railties/guides/source/active_record_querying.textile
@@ -869,7 +869,7 @@ SELECT count(*) AS count_all FROM clients WHERE (first_name = 'Ryan')
You can also use the +includes+ or +joins+ methods for this to do something a little more complex:
<ruby>
-Client.count.where("clients.first_name = 'Ryan' AND orders.status = 'received'").includes("orders")
+Client.where("clients.first_name = 'Ryan' AND orders.status = 'received'").includes("orders").count
</ruby>
Which will execute: