aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides
diff options
context:
space:
mode:
authorBen Orenstein <ben.orenstein@gmail.com>2011-05-26 20:52:22 -0400
committerBen Orenstein <ben.orenstein@gmail.com>2011-05-26 20:54:46 -0400
commit4807088fda43b5858ada61e822c7598e17c83417 (patch)
tree095578b72e3593da8f668170525fda830d7efbf4 /railties/guides
parentdfba8f544b96d326aa19e41d75a8b5a24525629e (diff)
downloadrails-4807088fda43b5858ada61e822c7598e17c83417.tar.gz
rails-4807088fda43b5858ada61e822c7598e17c83417.tar.bz2
rails-4807088fda43b5858ada61e822c7598e17c83417.zip
Don't you lie to me!
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 579a323d57..6cba34c7cd 100644
--- a/railties/guides/source/active_record_querying.textile
+++ b/railties/guides/source/active_record_querying.textile
@@ -483,13 +483,13 @@ SQL uses the +HAVING+ clause to specify conditions on the +GROUP BY+ fields. You
For example:
<ruby>
-Order.group("date(created_at)").having("created_at > ?", 1.month.ago)
+Order.group("date(created_at)").having("created_at < ?", 1.month.ago)
</ruby>
The SQL that would be executed would be something like this:
<sql>
-SELECT * FROM orders GROUP BY date(created_at) HAVING created_at > '2009-01-15'
+SELECT * FROM orders GROUP BY date(created_at) HAVING created_at < '2009-01-15'
</sql>
This will return single order objects for each day, but only for the last month.