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?
on 2007-04-02 10:06