Forum: Ruby on Rails Fixtures, HABTM and id values

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.
Colin L. (Guest)
on 2009-05-12 01:15
(Received via mailing list)
I have models Frog and Froglet with HABTM relationship between them.
In the fixtures file for froglets I can say
  frogs:  frog1, frog2, frog3
where frog1 etc are the names in the frog fixture, and the join table is
magically created for me.
This works fine provided the fixtures do not explicitly include id
for the frog and froglet records.

Unfortunately I have legacy code that requires that I explicitly specify
ids in the frog and froglet fixtures.  Is there anyway that I can
something like:
frogs: 1, 2, 3
where 1, 2, 3 are the id values obviously. I tried this but the join
was not correct.

This topic is locked and can not be replied to.