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

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request