title: rails has_many scope
body: <ol>
  <li><p>AppScreenshot</p>
  
  <pre><code>class AppScreenshot &lt; ActiveRecord::Base
    include Cacheable
    belongs_to :app
  
    model_cache do
      with_key
    end
  
    scope :available , where(["state &gt; ? and is_icon = ? ",0,0])
  
  end
  </code></pre></li>
  <li><p>App:</p>
  
  <pre><code>class App &lt; ActiveRecord::Base
    include Cacheable
    #acts_as_cached :ttl =&gt; 30.minutes
  
    has_many :apk_files
  
    has_many :app_screenshots.available
  
  end
  </code></pre></li>
  </ol>
  
  <p>why  <code>has_many :app_screenshots.available</code> ?</p>