Skip to content

Instantly share code, notes, and snippets.

@nicolasmarcal
Created January 5, 2017 11:21
Show Gist options
  • Save nicolasmarcal/b62842122775e73819f109e553a78c5d to your computer and use it in GitHub Desktop.
Save nicolasmarcal/b62842122775e73819f109e553a78c5d to your computer and use it in GitHub Desktop.
File.open("taxons_report.csv", "w") do |file|
file.puts "SKU;NOME;CATEGORIAS"
Spree::Variant.all.each do |variant|
file.puts "#{variant.sku};#{variant.product.name};#{variant.product.taxons.map(&:name).join(';')}"
end
end;nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment