title: Foreign reference in data mapper
body: <p>Say I have two data mapper classes like this:</p>
  
  <pre><code>class Family
     include DataMapper::Resource
  
     property :id,   Serial
     property :nice, Boolean
  end
  
  Class Person
     include DataMapper::Resource
  
     property :id, Serial
  
     belongs_to :family
  end
  </code></pre>
  
  <p>If I want to get all the people belonging to a certain family <code>family</code>, I can use this:</p>
  
  <pre><code>people=Person.all(:family=&gt;family)
  </code></pre>
  
  <p>But what if I want to get all people who belong to a family which have the <code>nice</code> attribute? In SQL I could do</p>
  
  <pre><code>SELECT * FROM persons, families WHERE persons.family_id=families.id AND families.nice
  </code></pre>
  
  <p>Is there a nice way to do this in data mapper without dropping to the underlying dataset?</p>