Hi --

On Mon, 12 Jan 2009, Phlip wrote:

> 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.

Rake will let you do that :-)

> 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!

I'd have to see the code to know exactly what's going on. Is it a
problem reconciling foreign key references?


David

-- 
David A. Black / Ruby Power and Light, LLC
Ruby/Rails consulting & training: http://www.rubypal.com
Coming in 2009: The Well-Grounded Rubyist (http://manning.com/black2)

http://www.wishsight.com => Independent, social wishlist management!