title: Testing if object exists in joined ActiveRecord query
body: <p>I have User model that is related to a Friend model (has_many / belongs_to)</p>
  
  <p>After joining, I would like to be able to check if a certain friend object exists in the friends that were joined to users:</p>
  
  <pre><code>users = User.joins(:friends).where("some condition")    # subset of total friends
  fs = Friend.all
  fs.each do |f|
    if users.friends.includes?(f) # match!
       ...
    else   # no match
       ...
  end
  </code></pre>
  
  <p>The code as-is does not work and I am having difficulties getting this functionality in code.</p>