Skip to content

Instantly share code, notes, and snippets.

@rubysolo
Created June 17, 2009 12:43
Show Gist options
  • Save rubysolo/131217 to your computer and use it in GitHub Desktop.
Save rubysolo/131217 to your computer and use it in GitHub Desktop.
named_scope :for_day, lambda { |date|
beginning = date.at_beginning_of_day
ending = beginning + 1.day
{ :conditions => ["placed_at BETWEEN ? AND ?", beginning.utc, ending.utc] }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment