lib/bill_hicks/inventory.rb in bill_hicks-1.1.9.pre vs lib/bill_hicks/inventory.rb in bill_hicks-1.1.9.pre2

- old
+ new

@@ -34,11 +34,11 @@ lines = ftp.gettextfile(INVENTORY_FILENAME, nil) CSV.parse(lines, headers: :first_row) do |row| inventory << { - brand: BillHicks::BrandConverter.convert(row.fetch('Product')), + brand_name: BillHicks::BrandConverter.convert(row.fetch('Product')), product: row.fetch('Product'), upc: row.fetch('UPC'), quantity: (Integer(row.fetch('Qty Avail')) rescue 0) } end @@ -57,10 +57,10 @@ ftp.chdir(BillHicks.config.top_level_dir) ftp.getbinaryfile(INVENTORY_FILENAME, temp_csv_file.path) SmarterCSV.process(temp_csv_file, { :chunk_size => size, :force_utf8 => true, :convert_values_to_numeric => false, }) do |chunk| chunk.each do |item| - item[:brand] = BillHicks::BrandConverter.convert(item[:product]) + item[:brand_name] = BillHicks::BrandConverter.convert(item[:product]) end yield(chunk) end