Closed bryanspears closed 3 years ago
Looks like the test fails to run. Locally the tests ran fine.
Won't this serialize the parent collection in its entirety instead of our paginated subset?
That's... true. Snap.
I'm currently out of ideas how to allow using other subcollections as the collection inside a subcollection. Other than creating a new module: "ampersand-all-the-things-subcollection" that allows for filtering and pagination. This worked pre-2.0 (I think. Did blanket upgrade on my modules. I'll have to check). I guess I'll just downgrade for now.
I think you're headed in the right direction w/ this fix, we just need to maybe handle serialize and toJSON manually instead of delegating. The only reason it was done this way was because we did it that way in the original, to prevent duplicated code. But when that's becoming a problem it's worth just dumping.
If not, and you have a subcollection as the collection, then you get infinite recursion and a bad time.
This fixes a serious issue that appears when you filter a paginated subcollection or vise-versa.