Skip to content

Instantly share code, notes, and snippets.

Created September 5, 2012 19:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/3642700 to your computer and use it in GitHub Desktop.
Save anonymous/3642700 to your computer and use it in GitHub Desktop.
{
:today => where(['created_at > ? and created_at < ?', Time.current.at_begi…
:yesterday => where(['created_at…
}.each {|name, time_period|
Foo.in_time_period.count # magic?
Bar.in_time_period.count # same magic!
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment