dresende/node-orm2 — pull request #386 by Tape (2013-11-13 23:22:11+00:00)
Title: Include merge options in chain find count

This change will not affect any existing results, however the use of such a feature looks like it's only compatible with SQL databases. I included a test case but I could not get it to pass on MongoDB (as such I have commented it out, but these tests will pass on MySQL, Postgres, and SQLite).

I was doing a chain find filter to do 2 separate queries: 1 would fetch a count of all results, one would use the exact same chain find data and do a count on it (for pagination reasons). While the regular .find() was returning the correct results (8 results), the count would return incorrect results since the merge information was absent (24 results), throwing off the pagination count data. This simple change will take that into account.