seed-fu-mongoid/README.md

28 lines
593 B
Markdown
Raw Normal View History

2013-02-20 18:09:29 +00:00
I missed [Seed Fu](https://github.com/mbleigh/seed-fu) when I was working on a Mongoid app, so I hacked this together in about 20 minutes.
No tests whatsoever but it works with my very simple Seed Fu-like seed data, so if you like it, contribute some tests!
## Usage
Seed files in `db/fixtures/*.rb`:
``` ruby
2013-02-20 18:41:10 +00:00
PermissionType.seed do |s|
s.id = 1
s.type = 'Users'
end
PermissionType.seed do |s|
s.id = 2
s.type = 'Sites'
end
2013-02-20 18:09:29 +00:00
```
Then `rake db:seed_fu` if you're in Rails.
Simple!
### Capistrano
`require 'seed-fu-mongoid/capistrano'` to have your data get re-seeded on deploy.