Re: Searching through HABTM

Jables
Fri, 30 May 2008 04:17:43 -0000

The problem I have is that f.find_all_by_ doesn''t work.  I have tried
find_all_by_genre and I get:
undefined method `find_all_by_genre''
I tried find_all_by_genre("GENRE", :include => :genres and no dice.

JB

On May 29, 8:53 pm, Phlip
<phlip2...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:
> > 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_.