Created
August 25, 2011 16:44
-
-
Save agoodman/1171119 to your computer and use it in GitHub Desktop.
Determinging monthly activity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this is really useful for collecting record counts into discrete buckets for visualization | |
(1..6).collect {|n| Query.where(['created_at > ?',Date.today-n.months]).where(['created_at < ?',Date.today-(n-1).months]).count} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment