Hi Dan,
You can insert the generated ID for any fixture using ERB:
foo:
bar_id: <%= Fixtures.identify(:the_target_fixture_label) %>
As far as polymorphic assoiations go, take a look at this patch:
http://dev.rubyonrails.org/ticket/10183
~ j.
The patch suggests this:
# instead of saying
foo:
pet_id: 1 # a pet fixture labelled "horace"
pet_type: Ferret
# you can say
foo:
pet: horace (Ferret)
But in fact you can do this:
foo:
pet: horace
pet_type: Ferret
This is good enough for me.
Tiago Macedo
There is a patch in the Rails Trac that allows you to specify ids and
still use foxy fixtures: http://dev.rubyonrails.org/ticket/10004/
As I need this patch and don't want to use a monkey patched version of
Rails, I turned this into a plugin:
http://portugueserb.rubyforge.org/svn/plugins/mixed_fixtures/
Tiago Macedo