title: Using scope, defined in parent model, inside it's child (STI pattern)
body: <p>I implement a class hierarchy using STI pattern</p>
  
  <pre><code>class A
    scope :aaa, where([someField]:[someValue])
  end
  
  class B &lt; A
  end
  </code></pre>
  
  <p>The problem is that when I try to call something like:</p>
  
  <pre><code>B.limit(5).aaa
  =&gt; SELECT "[table]".* FROM "[table]" WHERE "[table]"."type" IN ('A') AND ([someField] = [someValue]) LIMIT 5
  </code></pre>
  
  <p>So I am getting 5 objects of type A, which satisfies scope :aaa
  But I need to do the same with rows where type = "B"</p>
  
  <p>Is there any way to use scopes from parent, without redifinning it in childs in STI pattern?</p>
  
  <p>Thanks in advance</p>
  
  <p><strong>EDITED</strong></p>
  
  <p>I just discussed it with my frind and he showed me one important thing. A in not the root class of STI. IN fact whole hierarchy looks like</p>
  
  <pre><code>class O &lt; ActiveRecord::Base
  end
  
  class A &lt; O
    scope ..... .....
  end
  
  class B &lt; A
  end
  </code></pre>
  
  <p>maybe the reason is in hierarchy itself?...</p>