# Complicated association finder query

**URL:** <https://www.ruby-forum.com/t/complicated-association-finder-query/138560>\
**Category:** Rails\
**Created:** [May 24, 2008, 7:05pm UTC](https://www.ruby-forum.com/t/complicated-association-finder-query/138560 "2008-05-24T19:05:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![samuelzx](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/4491bb/32.png) [@samuelzx](https://www.ruby-forum.com/u/samuelzx)\
**Post date:** [May 24, 2008, 7:05pm UTC](https://www.ruby-forum.com/t/complicated-association-finder-query/138560/1 "2008-05-24T19:05:11Z")

</div>

Hi Guys,

If I may explain my problem with an example.

Models:

Monitor (computer monitors)  
has\_many :features

Feature:  
name = [big, small, black, white]

I want to find a Monitor that is BOTH white and big.

My first shot at this:  
find(:all, :include =\> :features, :conditions =\> [“name IN (‘white’,  
‘big’)” )

But this query will find Monitors that’s EITHER white or big.

I can’t figure this out. Can anyone help at all?

Xin
