title: Want to find records with no associated records in Rails
body: <p>Consider a simple association...</p>
  
  <pre><code>class Person
     has_many :friends
  end
  
  class Friend
     belongs_to :person
  end
  </code></pre>
  
  <p>What is the cleanest way to get all persons that have NO friends in ARel and/or meta_where?</p>
  
  <p>And then what about a has_many :through version</p>
  
  <pre><code>class Person
     has_many :contacts
     has_many :friends, :through =&gt; :contacts, :uniq =&gt; true
  end
  
  class Friend
     has_many :contacts
     has_many :people, :through =&gt; :contacts, :uniq =&gt; true
  end
  
  class Contact
     belongs_to :friend
     belongs_to :person
  end
  </code></pre>
  
  <p>I really don't want to use counter_cache - and I from what I've read it doesn't work with has_many :through</p>
  
  <p>I don't want to pull all the person.friends records and loop through them in Ruby - I want to have a query/scope that I can use with the meta_search gem</p>
  
  <p>I don't mind the performance cost of the queries</p>
  
  <p>And the farther away from actual SQL the better...</p>