Created
March 20, 2013 20:10
-
-
Save tagrudev/5208008 to your computer and use it in GitHub Desktop.
import csv to your posgre via rails yolo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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