title: How to get records from multiple condition from a same column through associated table
body: <p>Let say a book model <code>HABTM</code> categories, for an example book A has categories <code>"CA"</code> &amp; <code>"CB".</code><br/> How can i retrieve book A if I query using <code>"CA"</code> &amp; <code>"CB"</code> only. I know about the <code>.where("category_id in (1,2)")</code> but it uses <code>OR</code> operation. I need something like <code>AND</code> operation. </p>
  
  <p><strong>Edited</strong></p>
  
  <p>And also able to get books from category <code>CA</code> only. And how to include query criteria such as <code>.where("book.p_year = 2012")</code></p>