mongoid/mongoid — Issue #1338: scope.find returns document not within scope when identity-map enabled
Author: yfeldblum
Created: 2011-10-10 03:26:51+00:00
State: open

Here is [a failing spec](...) that should pass. It is a regression. The spec describes a particular instance of sending #find to a scope and passing in the ID of a document that is known not to be in that scope. Mongoid should raise in such a case, and did raise in the past, but has regressed and is not currently raising. Instead, Mongoid is returning the document whose ID was passed, even though the document is not in the scope. The failure occurs only when the identity-map is enabled.

More specifically, the spec passes in `v2.2.0` but fails in `v2.2.1`. The spec continues to fail in `v2.2.2` and `v2.3.0`. `git-bisect` pinpoints f46252ee46a56045564ec9e5d42b128d56f73b85 as the bad commit.