# Fixtures, HABTM and id values

**URL:** <https://www.ruby-forum.com/t/fixtures-habtm-and-id-values/167724>\
**Category:** Rails\
**Created:** [May 11, 2009, 11:15pm UTC](https://www.ruby-forum.com/t/fixtures-habtm-and-id-values/167724 "2009-05-11T23:15:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![colinloretz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/a698b9/32.png) [@colinloretz](https://www.ruby-forum.com/u/colinloretz)\
**Post date:** [May 11, 2009, 11:15pm UTC](https://www.ruby-forum.com/t/fixtures-habtm-and-id-values/167724/1 "2009-05-11T23:15:28Z")

</div>

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  
values  
for the frog and froglet records.

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

Colin
