Sha256: e5dfa0a7b0fc4905745d44e0ab295f11af5219ca21ae4d36e0f669f225fcf6e0
Contents?: true
Size: 483 Bytes
Versions: 6
Compression:
Stored size: 483 Bytes
Contents
require 'csv' module UsdaNutrientDatabase module Import class FoodGroups < UsdaNutrientDatabase::Import::Base def import UsdaNutrientDatabase.log 'Importing food groups' CSV.open( "#{directory}/FD_GROUP.txt", 'r:iso-8859-1:utf-8', csv_options ) do |csv| csv.each do |row| UsdaNutrientDatabase::FoodGroup.create! code: row[0], description: row[1] end end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems