Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Don't you lie to me!

  • Loading branch information...
commit 7dcbbae9ee0729c3b42161e1ccaf593c2b03ddc6 1 parent c32ba39
@r00k r00k authored fxn committed
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
@@ -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

I think it was correct before this change.

@r00k

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

Please sign in to comment.
Something went wrong with that request. Please try again.