X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FResultSet.pm;h=70025dbaf187c871349d3862b9b76caa6ee4bbea;hb=65ad59ab00bf973e5fd7a375927fd831e6b6e6dc;hp=4fff77e21734a826bbb6f5a5f4722c1555e90c09;hpb=a0726a33e1c8a66e531a021ffcc2b208afe2a3c8;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/ResultSet.pm b/lib/DBIx/Class/ResultSet.pm index 4fff77e..70025db 100644 --- a/lib/DBIx/Class/ResultSet.pm +++ b/lib/DBIx/Class/ResultSet.pm @@ -1268,6 +1268,14 @@ sub _construct_objects { my $rsrc = $self->result_source; my $attrs = $self->_resolved_attrs; + + if (!$fetch_all and ! $attrs->{order_by} and $attrs->{collapse}) { + # default order for collapsing unless the user asked for something + $attrs->{order_by} = [ map { join '.', $attrs->{alias}, $_} $rsrc->primary_columns ]; + $attrs->{_ordered_for_collapse} = 1; + $attrs->{_order_is_artificial} = 1; + } + my $cursor = $self->cursor; # this will be used as both initial raw-row collector AND as a RV of @@ -3545,13 +3553,6 @@ sub _resolved_attrs { } } - if (! $attrs->{order_by} and $attrs->{collapse}) { - # default order for collapsing unless the user asked for something - $attrs->{order_by} = [ map { "$alias.$_" } $source->primary_columns ]; - $attrs->{_ordered_for_collapse} = 1; - $attrs->{_order_is_artificial} = 1; - } - # if both page and offset are specified, produce a combined offset # even though it doesn't make much sense, this is what pre 081xx has # been doing