X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FOrdered.pm;h=409159eccd1c5bea1d1b10ec46cef4ad445b7895;hb=e8fb771b9060f47eac9eaeef1d722cfe0dcfbe76;hp=5f17790a9a884a3dfd162080a238f1c0900a416f;hpb=4ceaa6b5f05de445c7ffd4c47da2c81006050e62;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Ordered.pm b/lib/DBIx/Class/Ordered.pm index 5f17790..409159e 100644 --- a/lib/DBIx/Class/Ordered.pm +++ b/lib/DBIx/Class/Ordered.pm @@ -797,15 +797,15 @@ sub _shift_siblings { if (grep { $_ eq $position_column } ( map { @$_ } (values %{{ $rsrc->unique_constraints }} ) ) ) { - my @pcols = $rsrc->primary_columns; + my @pcols = $rsrc->_pri_cols; my $cursor = $shift_rs->search ({}, { order_by => { "-$ord", $position_column }, columns => \@pcols } )->cursor; my $rs = $self->result_source->resultset; - while (my @pks = $cursor->next ) { - + my @all_pks = $cusrsor->all; + while (my $pks = shift @all_pks) { my $cond; for my $i (0.. $#pcols) { - $cond->{$pcols[$i]} = $pks[$i]; + $cond->{$pcols[$i]} = $pks->[$i]; } $rs->search($cond)->update ({ $position_column => \ "$position_column $op 1" } );