In my daily development, I migrate back and forth between versions, and often do: rake load_fixtures... ... in order to populate my development database with fun data. Now, with any HABTM relationship, there are failures, as there is no way to say "which" fixtures to load first. Within an actual functional or unit test case, you could simply load them in the proper order, but I'm not doing any tests yet, but simply using the fixture data for development purposes. Either there is a major loophole in this process, or, I'm totally approaching this wrong. I'm voting for the latter :)
on 2006-02-23 00:47
on 2006-02-23 03:14
Found the answer, albeit, it would be nice if this feature existed natively within Rails :) http://kekova.ca/articles/2005/12/31/loading-your-... Thanks Chris !
on 2006-02-23 18:42
I had a related question... Does anyone know how to have the elements inside the fixtures loaded in order. I want to guarantee that the items in the yml fixture file get loaded in order (see below - item1 loaded before item2) item1: value: item2 value: Thanks, Zack