title: Rails, named scope not working
body: <p>I defined an simple named scope for my patient model, as you can see here:</p>
  
  <pre><code>class Patient &lt; ActiveRecord::Base
  has_many :treatments
  scope :recent_treatments, order('dateg desc')
  </code></pre>
  
  <p>So and in my view:</p>
  
  <pre><code>&lt;% @patient.recent_treatments.each do |treatment| %&gt;
    &lt;tr class="&lt;%= category_table_row_class(treatment.category) %&gt;"&gt;....
    &lt;td&gt;&lt;%= treatment.category.try(:typ) %&gt;&lt;span id="anzahl"&gt;&lt;%= tr.....
  </code></pre>
  
  <p>But somehow its not working, i get the error:</p>
  
  <pre><code> undefined method `recent_treatments' for #&lt;Patient:0x39a92f0&gt;
  </code></pre>
  
  <p>So i have no clue what i made wrong, besides this it would be nice if somebody could explain me why named scopes are not best practice in rails and what i should use instead? </p>