Skip to content

Commit

Permalink
Rails Guides: AR Querying, .count should be at the end as it returns …
Browse files Browse the repository at this point in the history
…a number. [#4811 state:resolved]
  • Loading branch information
rohitarondekar committed Jun 13, 2010
1 parent 27f337d commit b7a305f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion railties/guides/source/active_record_querying.textile
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -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: You can also use the +includes+ or +joins+ methods for this to do something a little more complex:


<ruby> <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> </ruby>


Which will execute: Which will execute:
Expand Down

0 comments on commit b7a305f

Please sign in to comment.