Displaying 1 result from an estimated 1 matches for "rest_id".
Did you mean:
reset_id
2006 Aug 22
0
Re: Problem with find condition and habtm relationship.
...;', ''kid-friendly''). The SQL you want should go
something like
select r.rest from rests r where not exists (select * from feats f
where f.feat in (''cheap'', ''kid-friendly'') and not exists (select *
from rests2feats r2f where r.id = r2f.rest_id and f.id = r2f.feat_id))
The key is in the two nested selects. They are looking for a counter-
example: a feat in (''cheap'', ''kid-friendly'') that your restaurant
doesn''t have -- ie, where there is no row in the habtm table linking
your restaurant an...