Re: Searching through HABTM

Phlip
Fri, 30 May 2008 03:53:07 -0000

> Story.find_by_genre_and_category_and_anotherthing("genre",
"category",
> "anotherthing", :conditions =>  "post_date <
somedate", :order =>
> "rating DESC")

Looks good. Try .find_all_by_...

If anotherthing is in another table, you will need to :include =>
:anotherthings, and you can''t use an automatic method named _and_.