Permalink
Browse files

Don't you lie to me!

  • Loading branch information...
r00k authored and fxn committed May 27, 2011
1 parent c32ba39 commit 7dcbbae9ee0729c3b42161e1ccaf593c2b03ddc6
Showing with 2 additions and 2 deletions.
  1. +2 −2 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.

2 comments on commit 7dcbbae

@hogan

This comment has been minimized.

Show comment Hide comment
@hogan

hogan Jun 8, 2011

I think it was correct before this change.

hogan replied Jun 8, 2011

I think it was correct before this change.

@r00k

This comment has been minimized.

Show comment Hide comment
@r00k

r00k Jun 8, 2011

Contributor

You're right: this change was incorrect. I fixed it in a later commit.

Contributor

r00k replied Jun 8, 2011

You're right: this change was incorrect. I fixed it in a later commit.

Please sign in to comment.