title: How do I select all child rows corresponding to a set of parent ids
body: <p>How do I select all child rows corresponding to a certain parent table using ActiveRecord queries.</p>
  
  <pre><code>create table foo (id, ...)
  create table bar (id, foo_id, ...)
  
  select * from foo where key = ? 
  # The above return a single row or multiple rows.
  
  select * from bar where foo_id in &lt;ids from the above output&gt;
  </code></pre>
  
  <p>How do I achieve this?</p>