# Finds on child models

**URL:** <https://www.ruby-forum.com/t/finds-on-child-models/90844>\
**Category:** Rails\
**Created:** [April 2, 2007, 10:06am UTC](https://www.ruby-forum.com/t/finds-on-child-models/90844 "2007-04-02T10:06:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![plewizard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ce7236/32.png) [@plewizard](https://www.ruby-forum.com/u/plewizard)\
**Post date:** [April 2, 2007, 10:06am UTC](https://www.ruby-forum.com/t/finds-on-child-models/90844/1 "2007-04-02T10:06:38Z")

</div>

i’ve looking for the sql to do a comparison of objects in a model’s  
has\_many objects. specifically it’s a simple model:

class Person  
has\_many :things  
end

class Things  
belongs\_to: person  
end

i can save the person and their 3 (or however many) things. now i  
just need a way to search their 3 things against all other people’s 3  
things to see if they’re the same. for instance.

@person.thing 1 = ‘baseball’  
@person.thing 2 = ‘tire’  
@person.thing 3 = ‘shovel’

what’s the sql (and it it possible with #find to return a collection  
of people with the same things that the person searching using 3 text  
fields has?
