From: Matt S Trout Date: Mon, 7 Oct 2013 00:14:20 +0000 (+0000) Subject: I think this time I have the weird AS-defaulting "logic" correctly ported X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1c92824b4f26300d4b1f901e43e1c803950cf2b5;p=dbsrgits%2FDBIx-Class-Historic.git I think this time I have the weird AS-defaulting "logic" correctly ported --- diff --git a/lib/DBIx/Class/SQLMaker.pm b/lib/DBIx/Class/SQLMaker.pm index cb0439e..6ed9c19 100644 --- a/lib/DBIx/Class/SQLMaker.pm +++ b/lib/DBIx/Class/SQLMaker.pm @@ -197,7 +197,10 @@ sub select { my $f = $fields->[$_]; if (ref $f) { $f = { '' => $f } unless ref($f) eq 'HASH'; - $f->{-as} ||= $final_attrs{as}[$_]; + ($f->{-as} ||= $final_attrs{as}[$_]) =~ s/\Q${\$self->name_sep}/__/g; + } elsif ($f !~ /^\Q$final_attrs{alias}${\$self->name_sep}/) { + $f = { '' => $f }; + ($f->{-as} ||= $final_attrs{as}[$_]) =~ s/\Q${\$self->name_sep}/__/g; } $f; } 0 .. $#$fields ];