title: Rails Array Conditions Query
body: <p>I've written the following method to combine the <code>References</code> of <code>Sections</code> model and it's children:</p>
  
  <pre><code>def combined_references
      ids = []
      ids &lt;&lt; self.id
      self.children.each do |child|
        ids &lt;&lt; child.id
      end
      Reference.where("section_id = ?", ids)
    end
  </code></pre>
  
  <p>But <code>section.combined_references</code> returns the following error:</p>
  
  <pre><code>Mysql2::Error: Operand should contain 1 column(s): SELECT `references`.* FROM `references`  WHERE (section_id = 3,4)
  </code></pre>
  
  <p>It seems to have collected the correct values for ids, have I structured the query incorrectly?</p>