Skip to content

Instantly share code, notes, and snippets.

@tagrudev
Created March 20, 2013 20:10
Show Gist options
  • Save tagrudev/5208008 to your computer and use it in GitHub Desktop.
Save tagrudev/5208008 to your computer and use it in GitHub Desktop.
import csv to your posgre via rails yolo
require 'csv'
namespace :seed do
desc "seed some awesomeness"
task :awesomeness => :environment do
CSV.foreach(File.join(Rails.root, 'lib/assets/yolo.csv')) do |row|
Awesome.create(:attribute_a => row[0], :attribute_b => row[1])
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment