E
Eric Marthinsen
Hello-
I'm using FasterCSV to export order records for our fulfillment partner.
Here's a boiled-down snippet of my code:
FasterCSV.open(filename, "w", :encoding => 'N') do |csv|
orders.each do |order|
order.items.each do |item|
csv << [
item.sku.sku,
item.quantity,
order.customer.first_name,
order.customer.last_name
]
end
end
end
If I had one order with two items, I'd expect the output to look like
this:
SKU001,1,John,Smith
SKU002,1,John,Smith
However, the output actually looks like this:
"SKU001,SKU002",1,John,Smith
It seems to be taking the common information and collapsing it onto a
single row. Does anyone know how to get the output to resemble what I
was expecting?
Thanks in advance,
Eric
I'm using FasterCSV to export order records for our fulfillment partner.
Here's a boiled-down snippet of my code:
FasterCSV.open(filename, "w", :encoding => 'N') do |csv|
orders.each do |order|
order.items.each do |item|
csv << [
item.sku.sku,
item.quantity,
order.customer.first_name,
order.customer.last_name
]
end
end
end
If I had one order with two items, I'd expect the output to look like
this:
SKU001,1,John,Smith
SKU002,1,John,Smith
However, the output actually looks like this:
"SKU001,SKU002",1,John,Smith
It seems to be taking the common information and collapsing it onto a
single row. Does anyone know how to get the output to resemble what I
was expecting?
Thanks in advance,
Eric