Skip to content

Commit

Permalink
extract date argument
Browse files Browse the repository at this point in the history
  • Loading branch information
svenfuchs committed Apr 16, 2013
1 parent 9718bd9 commit 3bccba6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion script/csv.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
APP_PATH = File.expand_path('../../config/application', __FILE__)
require File.expand_path('../../config/environment', __FILE__)

require 'date'
require 'csv'

orders = Order.where('created_at >= ?', Date.new(2012, 8, 1))
from = Date.parse(ARGV[0])
orders = Order.where('created_at >= ?', from)
orders = orders.includes(:user, :billing_address)

data = orders.map do |order|
Expand Down

0 comments on commit 3bccba6

Please sign in to comment.