Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sija/seedling
Rails 3 plugin for a database-independent YAML seeds import/export.
https://github.com/sija/seedling
rails ruby yaml
Last synced: 29 days ago
JSON representation
Rails 3 plugin for a database-independent YAML seeds import/export.
- Host: GitHub
- URL: https://github.com/sija/seedling
- Owner: Sija
- License: mit
- Created: 2012-06-28T10:43:41.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2012-10-31T03:57:16.000Z (about 12 years ago)
- Last Synced: 2023-04-10T11:59:17.829Z (over 1 year ago)
- Topics: rails, ruby, yaml
- Language: Ruby
- Homepage:
- Size: 113 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Seedling
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.## Installation
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.
## Usage
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.## 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