Let's say that I have two ActiveRecord models (or two tables in an SQL database, if you'd like). I have a User class and a Poll class. A User has_many Polls. When a user takes a Poll, they are asked whether or not they like apples, bananas, and cherries. The User's response to each of these things is recorded in a boolean column.
I'm interested in finding out which users have taken Polls and have responded that they like each of apples, bananas, and cherries at ANY time (not necessarily at the same time). Put differently, they do not need to have said that they like all three fruits during one Poll, they just need to have said that they like each of these things at some point, i.e. they need to have said that they like apples in at least one Poll, bananas in at least one Poll, and cherries in at least one Poll.
What's the right way to go about doing this in a general manner? Either an ActiveRecord or SQL query would be helpful.