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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Evan Weaver
2007-May-03 00:58 UTC
Re: Simple patch to allow references to other fixture data
Hey, yeah. This is a good solution to the fixture join problem, I think. Evan On 5/2/07, Mike Mangino <mmangino@technologyfusion.com> wrote:> > 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 > > > > > > >-- Evan Weaver Cloudburst, LLC --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Alain Ravet
2007-May-03 08:28 UTC
Re: Simple patch to allow references to other fixture data
> 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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---