# Where do you put helper functions for fixture generation?

**URL:** <https://www.ruby-forum.com/t/where-do-you-put-helper-functions-for-fixture-generation/184737>\
**Category:** Rails\
**Created:** [March 7, 2010, 6:01pm UTC](https://www.ruby-forum.com/t/where-do-you-put-helper-functions-for-fixture-generation/184737 "2010-03-07T18:01:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fearless\_fool](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/5e9695/32.png) [@fearless\_fool](https://www.ruby-forum.com/u/fearless_fool)\
**Post date:** [March 7, 2010, 6:01pm UTC](https://www.ruby-forum.com/t/where-do-you-put-helper-functions-for-fixture-generation/184737/1 "2010-03-07T18:01:15Z")

</div>

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.
