mongoid/mongoid — Issue #1489: any_in doesn't generate the right selector on referenced_in fields
Author: dougalcorn
Created: 2011-12-10 15:48:18+00:00
State: open

I'm trying to find objects who reference a list of other objects. The crux of it looks like this:

Connection.any_in(:from_id => [from_port.id, to_port.id])

As long as the field I'm searching on isn't a referenced_in foreign key it works fine. However, when I use one of the foreign key fields, it seems like #to_s is getting called on the selector.

The one thing I'm doing that seems off the golden path is using the uuid gem to generate rfc guids and use that for keys rather than bson object ids.

I've created a simple spec including uuid key fields that fails in this https://gist.github.com/1455417