Phlip
1/11/2009 4:04:00 PM
David A. Black wrote:
> Rails has a bunch of Rake tasks that copy the schema from one database
> to another. I don't know whether your project is a Rails application,
> but even if it isn't, you might be able to integrate one of those
> fairly easily, so that when you run your tests, the test database will
> pick up any changes in the development database.
However...
Every once in a while I feel the urge to think outside those ActiveRecord
scripts' box. For example, I want to write a method nab_fixtures('models.yml'),
and it will reach out to a yml file and load it, on command, without clawing its
way thru the uber-kewt fixtures() directive at the top of my suite.
When I feel that urge, I often have to repress it, because when I try to re-use
the code inside fixtures(), it's all "refactored" into a maze of fragile and
un-reusable methods. When I rewrite the system that loads a yml file into a
table myself, I replace fixtures() bugs with my own!
How the heck does anyone use ActiveRecord, with fixtures and migrations, outside
Rails? How, for example, can that magic luvvable plugable Merb do it??
--
Phlip