Here's another simple patch that allows you to try up fixtures:
http://dev.rubyonrails.org/ticket/7886
It also includes tests and rdoc. Basically, in a fixture, you can say
mike_user:
id: 2
account_id: <%= fixture :accounts, :elevatedrails%>
And that will grab the value from another fixture. It is dead simple and helps clean up fixtures.
Can we get this one applied as well?
Mike
http://www.elevatedrails.com
Evan4
(Evan)
2
Hey, yeah. This is a good solution to the fixture join problem, I think.
Evan
mike_user:
> id: 2
> account_id: <%= fixture :accounts, :elevatedrails%>
The fixture_reference plugin reuses a syntax we already know in Rails:
<%= fixtures :accounts %>
mike_user:
id: 2
account_id: <%= accounts(:elevatedrails) %>
I find that more readable.
Alain
http://blog.ravet.com