fearless_fool
2010-Mar-07 16:59 UTC
where do you put helper functions for fixture generation?
I''m writing a fixture in test/fixtures/parrots_model.yml, and I''m happily using ERB to flesh out my fixture. Suddenly, I realize that I need a helper function to call from my erb code, such as: polly: subtype: parakeet weight_kg: <%= ounces_to_kg(22.3) %> alex: subtype: african gray weight_kg: <%= ounces_to_kg(170.3) %> Where''s the right place to stash the "ounces_to_kg()" function so that it''s available when I rake db:load:fixtures? (And does the answer change if its a method specific to the parrot model?) tia. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.