title: Criteria for adding new method to a model in Rails application
body: <p>Recently we decided to make a general guideline for certain Rails3 project. And we experienced some troubles to formalize criteria: where code should be placed?</p>
  
  <p>For models we end up with following:
  Method should be added to the model if...</p>
  
  <ol>
  <li>it changes attributes of the model.</li>
  <li>it works as shortcut for long sequence of calls of model's methods and has a good(semantic) name.</li>
  <li>it redefine some functionality.</li>
  <li>it needs to be inserted due to architectural issues.</li>
  </ol>
  
  <p>Method should not be inserted if...</p>
  
  <ol>
  <li>it is used for representing data (except cases when Aggregations work).</li>
  <li>it is syntax sugar (syntax should be persistent)</li>
  <li>it returns constant value (use constants or class variables)</li>
  <li>it is alias for other method (use standard ruby ways to create aliases)</li>
  <li>it has more-less complex logic and does not change anything in the db (move it to the lib)</li>
  </ol>
  
  <p>What also can be added as criterion? Which books\articles covers such questions? </p>