Skip to content

Instantly share code, notes, and snippets.

@johnnygoodman
Created July 20, 2013 05:54
Show Gist options
  • Save johnnygoodman/6044026 to your computer and use it in GitHub Desktop.
Save johnnygoodman/6044026 to your computer and use it in GitHub Desktop.
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