Seedling is a database-independent tool for dumping and loading seed data. It complements the db:seed
rake task with loading/dumping data from/into YAML files. Provided data can be used to setup model attributes, properties and invoke methods with arguments. Exported data is saved to db/seed/dump/*.yml files, one per table.
This tool can be used as a replacement for mysqldump or pg_dump, but only for the ActiveRecord backed models. Users, permissions, schemas, triggers, and other advanced database features are not supported - by design.
Any database that has an ActiveRecord adapter should work. This gem is Rails 3 only.
Add this line to your application's Gemfile:
gem 'seedling', :github => 'Sija/seedling'
And then execute:
$ bundle
Or install it yourself as:
$ gem install seedling
All rake tasks will then be available to you.
rake db:seed:dump[dir] -> Dump contents of ActiveRecord models to db/seed/dump/*.yml
rake db:seed:load[dir] -> Seed the database with developments/ seeds.
rake db:seed -> Seed the database with once/ and always/ seeds.
- 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