aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides
diff options
context:
space:
mode:
authorVijay Dev <vijaydev.cse@gmail.com>2011-01-09 02:24:30 +0530
committerVijay Dev <vijaydev.cse@gmail.com>2011-01-09 02:24:30 +0530
commit4d29816fdad8bd8ed8eb98f12fda6a7b107cc7f4 (patch)
tree903c281020c303e5e2c4c50b02fef350d968dc62 /railties/guides
parentbc6e1a154a2df3096d36ed3612b0b93c0a466728 (diff)
downloadrails-4d29816fdad8bd8ed8eb98f12fda6a7b107cc7f4.tar.gz
rails-4d29816fdad8bd8ed8eb98f12fda6a7b107cc7f4.tar.bz2
rails-4d29816fdad8bd8ed8eb98f12fda6a7b107cc7f4.zip
fixed query output
Diffstat (limited to 'railties/guides')
-rw-r--r--railties/guides/source/active_record_querying.textile4
1 files changed, 2 insertions, 2 deletions
diff --git a/railties/guides/source/active_record_querying.textile b/railties/guides/source/active_record_querying.textile
index 6e45bf3188..22358029d4 100644
--- a/railties/guides/source/active_record_querying.textile
+++ b/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