Created
August 21, 2008 17:10
-
-
Save therealadam/6597 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
window = 14 | |
latest = Time.parse('12:00 AM') | |
earliest = today - window.days | |
issues = Issue.find(:conditions => ['updated_at > ? AND updated_at < ?', yesterday, today]) | |
issues_by_day = Hash.new { |key| self[key] = [] } | |
issues_by_day = issues.injecting(issues_by_day) do |buckets, issue| | |
buckets[issue.updated_at.strftime('%m/%d')] << issue | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment