Skip to content

Instantly share code, notes, and snippets.

@Eaven
Created May 1, 2016 01:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Eaven/7f159584db8b1c813a83b0b2156baa1c to your computer and use it in GitHub Desktop.
Save Eaven/7f159584db8b1c813a83b0b2156baa1c to your computer and use it in GitHub Desktop.
2.3.0 :011 > Post.where(:post_at => (DateTime.current..(DateTime.current - 5.minutes)))
Post Load (0.3ms) SELECT `posts`.* FROM `posts` WHERE (`posts`.`post_at` BETWEEN '2016-05-01 01:22:51' AND '2016-05-01 01:17:51')
=> #<ActiveRecord::Relation []>
2.3.0 :012 > DateTime.current
=> Sat, 30 Apr 2016 18:22:55 -0700
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment