Project

seedsv

0.0
No commit activity in last 3 years
No release in over 3 years
Seed your database with data from csv files with ease
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

~> 1.5.1
 Project Readme

Seedsv¶ ↑

Seed your Rails 3 models using CSV files.

Install it¶ ↑

In your gem file:

gem 'seedsv'

Using it¶ ↑

Seedsv requires the developer to create the folder:

Rails.root/db/csv

In this folder you will place all your CSV files with the same name as your database tables. The format of the first line of each file is the following:

column_name_1, column_name_2, column_name_3...

So for example, to seed the model City, you would normally have the file: /db/csv/cities.csv

This is the example content of the file

name, state_id
Monterrey, 1
Guadalajara, 2

To seed the database with this file

rake db:seed:csv

If something goes wrong and you want to delete everything seeded from CSV files:

rake db:seed:cleanup

RDoc¶ ↑

rdoc.info/github/adriancuadros/seedsv/master/frames

Copyright © 2010 Innku. See LICENSE for details.