datamapper / dm-aggregates

DataMapper plugin providing support for aggregates on collections
http://datamapper.org/
MIT License
16 stars 15 forks source link

Unexpected behavior when count is used with - #9

Open solnic opened 13 years ago

solnic commented 13 years ago

suppose a and b are collections return by finders on a class A:

suppose (a - b).count == 5

suppose we have a chained finder which returns only a subset of items of A:

(a - b).my_filter.count should be <= (a - b).count, but it is actually larger.

See the test case here:

https://gist.github.com/3569c20a3bf30f269699


Created by Matt - 2010-11-13 02:18:34 UTC

Original Lighthouse ticket: http://datamapper.lighthouseapp.com/projects/20609/tickets/1446

solnic commented 13 years ago

Confirmed - I have this very issue. :-\

by mephux

solnic commented 13 years ago

I’ve slightly fixed the example script so it won’t give a false negative when the bug is fixed, and also to use a memory DB:

https://gist.github.com/7fd9e5fe4362dd325092

by Jonathan Stott (namelessjon)

solnic commented 13 years ago

I have a similar issue and created a test case for it here: https://gist.github.com/700986

by Robert Sköld

solnic commented 13 years ago

[bulk edit]

by Dan Kubb (dkubb)