title: Get all articles that a certain user hasn't commented on
body: <p>I have three models: Article, Comment, User.</p>
  
  <p>A user can comment on an article. </p>
  
  <p>Here's how to get all articles where there's no comment at all, but I only want those that a certain user has <em>not</em> commented on yet:</p>
  
  <pre><code>Article.includes(:comments).where(:comments =&gt; { :id =&gt; nil })
  </code></pre>
  
  <p><strong>Update</strong></p>
  
  <pre><code>class Article
    has_many :comments
  end
  
  class Comment
    belongs_to :article
    belongs_to :user
  end
  
  class User
    has_many : comments
  end
  </code></pre>