Skip to content

Instantly share code, notes, and snippets.

@Frank004
Last active June 3, 2016 16:12
Show Gist options
  • Select an option

  • Save Frank004/a3e176a6a139c4bbc9a2500edfbe18c1 to your computer and use it in GitHub Desktop.

Select an option

Save Frank004/a3e176a6a139c4bbc9a2500edfbe18c1 to your computer and use it in GitHub Desktop.
@two_week = 14.days.ago.to_date..Time.now.utc.to_date
current_user.glycemiuns.where(['glycemia_date = ?', @two_week]).each do |date|
irb(main):058:0> 14.days.ago.to_date..Time.now.utc.to_date
=> Fri, 20 May 2016..Fri, 03 Jun 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment