binarylogic / searchlogic

Searchlogic provides object based searching, common named scopes, and other useful tools.
http://rdoc.info/projects/binarylogic/searchlogic
MIT License
1.39k stars 133 forks source link

Associations using any return duplicated results #116

Open caseyhoward opened 14 years ago

caseyhoward commented 14 years ago

Let's say I have a model User that has and belongs to many Teams. We also have one user with id 1 who has two teams with id's 1 and 2.

> User.teams_id_is_any(1,2)
=> [ <User id: 1>, <User id: 1> ]

I think this happens because searchlogic uses the :joins option instead of :include. I know that is done as an optimization, but if I get bad results it doesn't really help me. Can there be some sort of option to use :include instead of :joins?

jDeppen commented 12 years ago

Same here, I had to call uniq on the array