From: Rob Kinyon Date: Wed, 18 Feb 2009 19:10:51 +0000 (+0000) Subject: Alias properly checks ->{attrs}{alias} X-Git-Tag: v0.08240~63^2~20 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=18c72236adec093c680be1c00df7297c42b907eb;p=dbsrgits%2FDBIx-Class.git Alias properly checks ->{attrs}{alias} --- diff --git a/lib/DBIx/Class/ResultSet.pm b/lib/DBIx/Class/ResultSet.pm index 29810f5..96ba9ae 100644 --- a/lib/DBIx/Class/ResultSet.pm +++ b/lib/DBIx/Class/ResultSet.pm @@ -2320,7 +2320,7 @@ sub _resolved_attrs { push(@{$attrs->{as}}, @$adds); } - $attrs->{from} ||= [ { 'me' => $source->from } ]; + $attrs->{from} ||= [ { $self->{attrs}{alias} => $source->from } ]; if (exists $attrs->{join} || exists $attrs->{prefetch}) { my $join = delete $attrs->{join} || {}; diff --git a/t/search/subquery.t b/t/search/subquery.t index f6a00dd..bb11a39 100644 --- a/t/search/subquery.t +++ b/t/search/subquery.t @@ -93,4 +93,6 @@ TODO: { ); } +my $rs = $cdrs->search( undef, { alias => 'foo' } ); +warn ${$rs->as_query}->[0], $/; __END__