Forum: Ruby on Rails Fixtures wishlist

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.
Bec38d63650c8912b6ba9b557fb953b9?d=identicon&s=25 Roger Pack (rogerdpack)
on 2007-04-18 01:51
I'm sure this has been mentioned on the group before,'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
 id: 3
 user: User(:bob)

ahh that would be so nice.
Any thots?
981b75f949c81efad3bc4b3c4ea88332?d=identicon&s=25 Scott Becker (Guest)
on 2007-04-18 02:08
(Received via mailing list)
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:

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

For #3: Try the Fixture References plugin:

Also if you want to dump your existing database tables to yaml fixtures,
the AR Fixtures plugin -

Scott Becker
Electro Interactive, Inc.
Office: 813-333-5508
This topic is locked and can not be replied to.