# Changing ids for fixtures in 2.0

**URL:** <https://www.ruby-forum.com/t/changing-ids-for-fixtures-in-2-0/122602>\
**Category:** Rails\
**Created:** [December 10, 2007, 2:38am UTC](https://www.ruby-forum.com/t/changing-ids-for-fixtures-in-2-0/122602 "2007-12-10T02:38:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![namxam](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/f19dbf/32.png) [@namxam](https://www.ruby-forum.com/u/namxam)\
**Post date:** [December 10, 2007, 2:38am UTC](https://www.ruby-forum.com/t/changing-ids-for-fixtures-in-2-0/122602/1 "2007-12-10T02:38:58Z")

</div>

Well, I am not sure if I am doing something wrong, or if this behavior  
is intendedâ€¦ but somehow my tests are failing for rails 2.0

Ok, here is my setup. First have a look at my fixtures (events habtm  
users (as hosts))

[users.yml]  
admin:  
login: administrator  
billie:  
login: billie\_the\_kid

[events.yml]  
my\_event:  
title: My little test event  
hosts: billie

This works great so far and when using UI no problems so far. But when  
using the hash to access a host id like:

events(:my\_event).host\_ids

the returned array is different for every test I run. This way all tests  
fail. Any ideas why this is the case?

Max

---

<div class="post-metadata">

**Author:** ![namxam](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/f19dbf/32.png) [@namxam](https://www.ruby-forum.com/u/namxam)\
**Post date:** [December 10, 2007, 3:11am UTC](https://www.ruby-forum.com/t/changing-ids-for-fixtures-in-2-0/122602/2 "2007-12-10T03:11:11Z")

</div>

Well, it was my fault 😉  
I had ids in my join\_table. This way the events(:my\_event).host\_ids call  
returned these ids instead of the user ids.
