Forum: Ruby on Rails Fixtures and Relationships

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ff82af3238a57fbd1212832ec1a19f28?d=identicon&s=25 Dylan Stamat (Guest)
on 2006-02-22 23: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
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 :)
Ff82af3238a57fbd1212832ec1a19f28?d=identicon&s=25 Dylan Stamat (Guest)
on 2006-02-23 02:14
(Received via mailing list)
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 !
C4dc94c893471878a105761a9207f29b?d=identicon&s=25 Zack Chandler (Guest)
on 2006-02-23 17:42
(Received via mailing list)
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
This topic is locked and can not be replied to.