search for: book_category_rel

Displaying 1 result from an estimated 1 matches for "book_category_rel".

2011 Feb 07
2
Search HABTM relationship in ActiveRecord
Consider the following scenario: Book has_and_belong_to_many Category. In other words, a category may have a lot of books, and a book can have more than one category. What is the best practice to query all books related to some specified categories. For example, if I have following books "From Java To Ruby" - Category: Java, Ruby "Ruby Programming" - Category: Ruby