# Fixture question

**URL:** <https://www.ruby-forum.com/t/fixture-question/53533>\
**Category:** Rails\
**Created:** [February 8, 2006, 7:24pm UTC](https://www.ruby-forum.com/t/fixture-question/53533 "2006-02-08T19:24:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![nicksnels](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/aca169/32.png) [@nicksnels](https://www.ruby-forum.com/u/nicksnels)\
**Post date:** [February 8, 2006, 7:24pm UTC](https://www.ruby-forum.com/t/fixture-question/53533/1 "2006-02-08T19:24:49Z")

</div>

Ok, I’m pretty sure I’ve seen this done before. I have a fixture that  
isn’t named the same as the table I want to insert the stuff into.  
Whats the right way to go about this?!

Google has failed me! ☹

-Nick

---

<div class="post-metadata">

**Author:** ![nicksnels](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/aca169/32.png) [@nicksnels](https://www.ruby-forum.com/u/nicksnels)\
**Post date:** [February 8, 2006, 10:02pm UTC](https://www.ruby-forum.com/t/fixture-question/53533/2 "2006-02-08T22:02:00Z")

</div>

Nick S. wrote:

> Ok, I’m pretty sure I’ve seen this done before. I have a fixture that  
> isn’t named the same as the table I want to insert the stuff into.  
> Whats the right way to go about this?!

Unless you’re doing wizardly fixture sharing the simplest thing would be  
to rename the yml file. Otherwise you need to embed ruby snippets into  
the  
fixtures, same as you do for rhtml files in your views

zsombor

---

<div class="post-metadata">

**Author:** ![nicksnels](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/aca169/32.png) [@nicksnels](https://www.ruby-forum.com/u/nicksnels)\
**Post date:** [February 8, 2006, 10:37pm UTC](https://www.ruby-forum.com/t/fixture-question/53533/3 "2006-02-08T22:37:44Z")

</div>

Could of sworn I saw this somewhere, maybe I’m wrong. The reason I ask  
is for testing STI, and having the different classes be allowed to use  
different fixtures…meh, guess I’ll stick em all in one file then.

Thanks anyways!  
-Nick

---

<div class="post-metadata">

**Author:** ![nicksnels](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/aca169/32.png) [@nicksnels](https://www.ruby-forum.com/u/nicksnels)\
**Post date:** [February 9, 2006, 2:08am UTC](https://www.ruby-forum.com/t/fixture-question/53533/4 "2006-02-09T02:08:35Z")

</div>

That looks like what I ran across last time! Thanks Tony!

-Nick

---

<div class="post-metadata">

**Author:** ![nicksnels](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/aca169/32.png) [@nicksnels](https://www.ruby-forum.com/u/nicksnels)\
**Post date:** [February 9, 2006, 12:42am UTC](https://www.ruby-forum.com/t/fixture-question/53533/5 "2006-02-09T00:42:11Z")

</div>

Have a look at:  
[http://wiki.rubyonrails.com/rails/pages/FlexibleFixtures](http://wiki.rubyonrails.com/rails/pages/FlexibleFixtures)  
Sounds like what you are after.  
Knew I’d seen it somewhere as well 🙂  
Cheers,  
Tony
