title: ActiveRecord Query: select record where has at least one in a has many relationship
body: <p>Say you have this:</p>
  
  <pre><code>class Question &lt; ActiveRecord::Base
   has_many :answers
  end
  
  class Answer &lt; ActiveRecord::Base
   belongs_to :question
  end
  </code></pre>
  
  <p>How do I search for all the questions that have answers without getting duplicate questions? </p>
  
  <p>Say a question has two answers, if you do this: </p>
  
  <pre><code>Question.joins(:answers)
  </code></pre>
  
  <p>because it is an inner join, you'll get the question multiple times. </p>
  
  <p>Is there a way to do this through the query interface without having to do a raw sql distinct or unique? </p>