title: Rails: Helpers and Models - where to organize code
body: <p>More and more I'm putting all of my code in models and helpers concerning MVC.</p>
  
  <p>However, sometimes I'm not sure where to organize code. Should it go into the model or should it go into a helper. What are the benefits of each. Is one faster or are they the same. I've heard something about all models getting cached so it seems then like that would be a better place to put most of my code.</p>
  
  <p>For example here is a scenario that works in a model or in helper: </p>
  
  <pre><code> def status
    if self.purchased
     "Purchased"
    elsif self.confirmed
     "Confirmed"
    elsif self.reserved
     "Reserved"
    else
     "Pending"
    end
  </code></pre>
  
  <p>end</p>
  
  <p>I don't need to save this status as in the database because there are boolean fields for purchased, and confirmed, and reserved. So why put this in a model or why put it into a helper?</p>
  
  <p>So I'm not sure of the best practice or benefits gained on putting code into a model or into helper if it can be in both.</p>