Created
July 20, 2013 05:54
-
-
Save johnnygoodman/6044026 to your computer and use it in GitHub Desktop.
This file contains 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
require 'contextio' | |
require 'active_support/all' | |
require 'date' | |
contextio = ContextIO.new('key', 'secret') | |
account = contextio.accounts.where(email: '[email protected]').first | |
date_before = Time.now.utc - 30.minutes | |
date_after = Time.now.utc - 1.minute | |
puts date_before.utc? # => Yes | |
puts date_after.utc? # => Yes | |
puts date_before.class # => Time | |
puts date_after.class # => Time | |
account.messages.where(before_after: date_after.to_i).count # => 25 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment