From: Matt S Trout Date: Mon, 16 Apr 2012 14:33:30 +0000 (+0000) Subject: switch _construct_objects prefetch to DQ X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=553ef4bf4f8659a40be5ff1095e19f219c9e643d;p=dbsrgits%2FDBIx-Class-Historic.git switch _construct_objects prefetch to DQ --- diff --git a/lib/DBIx/Class/ResultSet.pm b/lib/DBIx/Class/ResultSet.pm index ae29895..b959d14 100644 --- a/lib/DBIx/Class/ResultSet.pm +++ b/lib/DBIx/Class/ResultSet.pm @@ -1446,10 +1446,15 @@ sub _construct_objects { else { $attrs->{_ordered_for_collapse} ||= (!$attrs->{order_by}) ? undef : do { my $st = $rsrc->schema->storage; - my @ord_cols = map - { $_->[0] } - ( $st->_extract_order_criteria($attrs->{order_by}) ) - ; + my $conv = $self->_sqla_converter; + my @order_by_dq = $self->_extract_by_from_order_by( + $conv->_order_by_to_dq($attrs->{order_by}) + ); + my @ord_cols = map { + $_->{type} eq DQ_IDENTIFIER + ? join(',',@{$_->{elements}}) + : '__TOTALLY_BOGUS_DUDE__' + } @order_by_dq; my $colinfos = $st->_resolve_column_info($attrs->{from}, \@ord_cols);