Browse files

fixed query output

  • Loading branch information...
1 parent bc6e1a1 commit 4d29816fdad8bd8ed8eb98f12fda6a7b107cc7f4 @vijaydev vijaydev committed Jan 9, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 railties/guides/source/active_record_querying.textile
View
4 railties/guides/source/active_record_querying.textile
@@ -440,7 +440,7 @@ And this will give you a single +Order+ object for each date where there are ord
The SQL that would be executed would be something like this:
<sql>
-SELECT * FROM orders GROUP BY date(created_at)
+SELECT * FROM orders GROUP BY date(created_at) ORDER BY created_at
</sql>
h3. Having
@@ -664,7 +664,7 @@ Eager loading is the mechanism for loading the associated records of the objects
Consider the following code, which finds 10 clients and prints their postcodes:
<ruby>
-clients = Client.all(:limit => 10)
+clients = Client.limit(10)
clients.each do |client|
puts client.address.postcode

0 comments on commit 4d29816

Please sign in to comment.