Pop
Seeding helpers for Rails.
Installation
Add this line to your application's Gemfile:
gem 'pop'
And then execute:
$ bundle
Or install it yourself as:
$ gem install pop
Usage
on seeds.rb:
# Delete the records of a given table
Pop.clean :cities, :countries
# Populate a table/collection
Pop.populate :cities # Rails.root/db/cities.yml by default
Pop.populate :countries, "/db/data/countries.yaml"
# Clean and Populate a table
Pop.setup :cities
Pop.setup :countries, "/db/data/countries.yml"
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request