The following query doesn't do as you might think:
Perpetuity[User].select { email == @email }
This is because the DSL evaluates in the context of a Perpetuity::MongoDB::Query to make use of method_missing to find out which attributes are being used. We might be able to do a different type of select that resembles Enumerable more closely (as in mapper.select { |user| user.email == @email }) by calling the block with a Query as an argument rather than using instance_exec on the block.
The following query doesn't do as you might think:
This is because the DSL evaluates in the context of a
Perpetuity::MongoDB::Query
to make use ofmethod_missing
to find out which attributes are being used. We might be able to do a different type of select that resemblesEnumerable
more closely (as inmapper.select { |user| user.email == @email }
) by calling the block with aQuery
as an argument rather than usinginstance_exec
on the block.Will investigate.