Subject: | DBIx::Class::ResultSetColumn does not respect +select, +as |
The comments in DBIx::Class::ResultSetColumn::new suggest that it is intented that +select and +as should also be looked at for column definitions, as well as select/as. However, they are not checked, which results in that part of the query being lost.
I think this should get us most of the way there:
+ my $plus_as_list = $orig_attrs->{'+as'} || [];
+ my $plus_select_list = $orig_attrs->{'+select'} || [];
+ my $plus_as_index = List::Util::first { ($plus_as_list->[$_] || "") eq $column } 0..$#$plus_as_list;
- my $select = defined $as_index ? $select_list->[$as_index] : $column;
+ my $select = defined $as_index ? $select_list->[$as_index] : defined $plus_as_index ? $plus_select_list->[$plus_as_index] : $column;
(I am using 0.082841 as a reference - the most recent stable release.)