Fixtures and Relationships

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 :slight_smile:

Found the answer, albeit, it would be nice if this feature existed
natively
within Rails :slight_smile:
http://kekova.ca/articles/2005/12/31/loading-your-test-db-to-your-development-db

Thanks Chris !

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