Forum: Ruby on Rails Fixtures and Relationships

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Dylan S. (Guest)
on 2006-02-23 00:47
(Received via mailing list)
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
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 :)
Dylan S. (Guest)
on 2006-02-23 03:14
(Received via mailing list)
Found the answer, albeit, it would be nice if this feature existed
within Rails :)

Thanks Chris !
Zack C. (Guest)
on 2006-02-23 18:42
(Received via mailing list)
I had a related question... Does anyone know how to have the elements
the fixtures loaded in order.  I want to guarantee that the items in the
fixture file get loaded in order (see below - item1 loaded before item2)



This topic is locked and can not be replied to.