$rs->reset;
my $j_rs = $rs->search ({}, { join => 'tracks' })->get_column ('cdid');
is_deeply (
- [ $j_rs->all ],
- [ map { my $c = $rs->next; ( ($c->id) x $c->tracks->count ) } (1 .. $rs->count) ],
+ [ sort $j_rs->all ],
+ [ sort map { my $c = $rs->next; ( ($c->id) x $c->tracks->count ) } (1 .. $rs->count) ],
'join properly explodes amount of rows from get_column',
);
for my $tr ($cd->tracks->all) {
push @{$data->{tracks}}, { $tr->get_columns };
}
+ @{$data->{tracks}} = sort { $a->{trackid} <=> $b->{trackid} } @{$data->{tracks}};
push @cds_and_tracks, $data;
}
for my $tr ($cd->tracks->all) {
push @{$data->{tracks}}, { $tr->get_columns };
}
+ @{$data->{tracks}} = sort { $a->{trackid} <=> $b->{trackid} } @{$data->{tracks}};
push @pref_cds_and_tracks, $data;
}
);
cmp_deeply (
- [ $pref_rs->search ({}, { result_class => 'DBIx::Class::ResultClass::HashRefInflator' })->all ],
+ $pref_rs->search ({}, { order_by => [ { -desc => 'me.year' }, 'trackid' ] })->all_hri,
\@cds_and_tracks,
'Correct HRI collapsing on non-unique primary object'
);