# Fixtures wishlist

**URL:** <https://www.ruby-forum.com/t/fixtures-wishlist/92303>\
**Category:** Rails\
**Created:** [April 18, 2007, 1:51am UTC](https://www.ruby-forum.com/t/fixtures-wishlist/92303 "2007-04-18T01:51:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rogerdpack](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/45deac/32.png) [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Post date:** [April 18, 2007, 1:51am UTC](https://www.ruby-forum.com/t/fixtures-wishlist/92303/1 "2007-04-18T01:51:45Z")

</div>

I’m sure this has been mentioned on the group before, but…here’s my  
fixtures wish-list

1. per “test” fixtures
2. within the fixtures be able to run some arbitrary Ruby code (like a  
function at the bottom of the yaml code that is run after loading up the  
fixtures–that would be nice).
3. “cross-linking” among fixtures ala  
CoolEntry:  
id: 3  
user: User(:bob)

ahh that would be so nice.  
Any thots?  
-Roger

---

<div class="post-metadata">

**Author:** ![rogerdpack](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/45deac/32.png) [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Post date:** [April 18, 2007, 2:08am UTC](https://www.ruby-forum.com/t/fixtures-wishlist/92303/2 "2007-04-18T02:08:48Z")

</div>

For #1: You could try the Fixture Sets plugin, although I haven’t needed  
this personally. One set is enough to worry about, but to each his own:  
[http://thatswhatimtalkingabout.org/news/2006/8/31/fixture-sets-for-rails](http://thatswhatimtalkingabout.org/news/2006/8/31/fixture-sets-for-rails)

For #2: Fixtures are evaluated with ERB. Just put some ruby between \<%  
%\>  
and it will execute.

For #3: Try the Fixture References plugin:  
[http://wiki.pluginaweek.org/Fixture\_references](http://wiki.pluginaweek.org/Fixture_references)

Also if you want to dump your existing database tables to yaml fixtures,  
try  
the AR Fixtures plugin -  
[http://agilewebdevelopment.com/plugins/ar\_fixtures](http://agilewebdevelopment.com/plugins/ar_fixtures)

–  
Scott B.  
Electro Interactive, Inc.  
Office: 813-333-5508

> **[Electro Interactive - Web Development. Ruby on Rails. Web Standards.](http://www.electrointeractive.com)**
>
> Electro Interactive is a full service new media design and development company.
