Skip to content

Instantly share code, notes, and snippets.

@mattfitzgerald
Created July 31, 2013 05:42
Show Gist options
  • Save mattfitzgerald/6119599 to your computer and use it in GitHub Desktop.
Save mattfitzgerald/6119599 to your computer and use it in GitHub Desktop.
start_date = Date.new(2013,1,1)
end_date = start_date + 1.month
Payment.where(item: 'subscription', transaction_state: 'success', created_at: start_date..end_date).sum(:amount_in_cents)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment