Association Label Links

Rails provides tag links for associations in such fixtures:

### in pirates.yml reginald: name: Reginald the Pirate monkey: george ### in monkeys.yml george: name: George the Monkey pirate: reginald 

This is great for models with unnamed places, but I use namespaces, so Rails gets confused and wants to insert labels instead of label references.

Any known workaround or fix?

+4
source share
1 answer

Fixtures.identify seems like the only solution, not very pretty, but better than identifiers.

 ### in pirates.yml reginald: name: Reginald the Pirate monkey_id: <%= Fixtures.identify(:george) %> ### in monkeys.yml george: name: George the Monkey pirate_id: <%= Fixtures.identify(:reginald) %> 
+4
source

All Articles