Skip to content

Instantly share code, notes, and snippets.

@jweslley
Created July 21, 2010 14:08
Show Gist options
  • Save jweslley/484539 to your computer and use it in GitHub Desktop.
Save jweslley/484539 to your computer and use it in GitHub Desktop.
Rails: loading seeds from csv
require 'csv'
CSV.foreach('path/to/seed.csv', headers: true, col_sep: ';') do |row|
Model.create row.to_hash
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment