Let say a book model HABTM
categories, for an example book A has categories "CA"
& "CB".
How can i retrieve book A if I query using "CA"
& "CB"
only. I know about the .where("category_id in (1,2)")
but it uses OR
operation. I need something like AND
operation.
Edited
And also able to get books from category CA
only. And how to include query criteria such as .where("book.p_year = 2012")