From: Peter Rabbitson Date: Tue, 27 Sep 2016 18:20:13 +0000 (+0200) Subject: Simplify internal implementation of as_subselect_rs X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9ab0364d36a4357b766f6dfccfb1df5ef69b079b;p=dbsrgits%2FDBIx-Class.git Simplify internal implementation of as_subselect_rs Zero functional changes --- diff --git a/lib/DBIx/Class/ResultSet.pm b/lib/DBIx/Class/ResultSet.pm index 1d6d177..2d6ea30 100644 --- a/lib/DBIx/Class/ResultSet.pm +++ b/lib/DBIx/Class/ResultSet.pm @@ -3506,7 +3506,7 @@ but because we isolated the group by into a subselect the above works. sub as_subselect_rs { my $self = shift; - my $attrs = $self->_resolved_attrs; + my $alias = $self->current_source_alias; my $fresh_rs = (ref $self)->new ( $self->result_source @@ -3518,11 +3518,11 @@ sub as_subselect_rs { return $fresh_rs->search( {}, { from => [{ - $attrs->{alias} => $self->as_query, - -alias => $attrs->{alias}, + $alias => $self->as_query, + -alias => $alias, -rsrc => $self->result_source, }], - alias => $attrs->{alias}, + alias => $alias, }); }