Skip to content

Instantly share code, notes, and snippets.

@jpablobr
Created June 28, 2010 23:24
Show Gist options
  • Select an option

  • Save jpablobr/456536 to your computer and use it in GitHub Desktop.

Select an option

Save jpablobr/456536 to your computer and use it in GitHub Desktop.
require 'fastercsv'
FasterCSV.foreach('db/data/file.csv') do |row|
Model.create(:name=>row[0], :phone_number=>row[1], :fax_number=>row[2], :email=>row[3]) #etc...
end
# $ rake db:load_from_csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment