It's important to have useful test data during development and debugging, resembling real-world data. It can be cumbersome to setup and maintain though. This is a mini-framework to help with seeding in Rails using a Domain Specific Language approach.
- I got tired of maintaining seeds.rb idempotently. Too dangerous to run this directly into production and overall, cumbersome to make it idempotent (ie work whether or not the objects already exist). So I decided to just make something that's just used for development, starting from an empty DB each time. I'm now maintaining a separate folder of individual data migrations to be performed in production. There's also separate fixtures for testing (separate data than this for performance reasons, and because tests need different kinds of data).
- It's modular enough for parts to be invoked during testing.
- The modularity is also part of a domain-specific language approach to seeding, as can be seen in the examples.
Just include the files as above. This is a quick rough cut, you'll need to fill in more details.