title: Rails Scope where most recent association is older than 1 month
body: <p>I have two models in my app, one called <code>Feed</code> and one called <code>Post</code>. A feed has many posts.</p>
  
  <p>I am looking for a way to return the feeds where the most recent post is older than 1 month.</p>
  
  <p>I've got something simple like:</p>
  
  <pre><code>class Feed &lt; ActiveRecord::Base
    has_many :posts
  
    scope :no_recent_posts, -&gt; { includes(:posts).where('posts.created_at &gt; ?', 1.month.ago) }
  end
  </code></pre>
  
  <p>but of course this also returns any feeds if they have old posts (even if they have more recent ones too.</p>
  
  <p>Maybe something with a <code>limit(1</code>) and an <code>order</code>?</p>