Closed hamsterready closed 11 years ago
It seems like there is kind-of optimization in code which ignores other query parameters when there is "id" included in original query.
For instance query like:
geddy.model.User.first({id: x, companyId: y}, ...
may return user with companyId != y.
It seems to be here: https://github.com/mde/model/blob/master/lib/query/query.js#L289
Easy to workaround in my code (as I can query by id and then compare manually against y...) but not very intuitive and results were at least confusing ;-)
Yes, this does appear to be broken. Added a test in baa99ad4a15f2c6557aa42c7bde136c052473892
@mde does that fix look right to you?
Pushed to NPM, v0.2.8.
It seems like there is kind-of optimization in code which ignores other query parameters when there is "id" included in original query.
For instance query like:
may return user with companyId != y.
It seems to be here: https://github.com/mde/model/blob/master/lib/query/query.js#L289
Easy to workaround in my code (as I can query by id and then compare manually against y...) but not very intuitive and results were at least confusing ;-)