Fix _resolve_collapse to always consider the entire chain of parent ids
Instead of relying on a "local column based" resolution for a particular
node, always add all the "collapsers" of the left-side "parents".
In the process cleanup the return of _resolve_collapse, and make it more
generic (after all we are hoping to CPAN the collapser generator some
day).
The change above solves the following problem: think of an artist with
3 CDs A, B & C:
$cd_rs->search(
[
{ 'me.title' => 'A', 'cds.title' => { '!=' => 'B' } },
{ 'me.title' => { '!=', => 'A' }, 'cds.title' => 'B' },
],
{ prefetch => { artist => 'cds' } },
);
Since an artist is fully defined by its PK (which we already fetch),
an all() run will keep accumulating all 3 CDs under the same already
known hash, representing said artist, because we do not create two
distinct pigeon-hole-hashes for "artist of A" and "artist of non-A".