use strict;
use warnings;
-sub _select_columns {
- return shift->columns('Essential');
+sub resultset_instance {
+ my $self = shift;
+ my $rs = $self->next::method(@_);
+ $rs = $rs->search(undef, { cols => [ $self->columns('Essential') ] });
+ return $rs;
}
sub get_column {
$attrs = Storable::dclone($attrs || {}); # { %{ $attrs || {} } };
my %seen;
my $alias = ($attrs->{alias} ||= 'me');
- if (!$attrs->{select}) {
+ if ($attrs->{cols} || !$attrs->{select}) {
+ delete $attrs->{as} if $attrs->{cols};
my @cols = ($attrs->{cols}
? @{delete $attrs->{cols}}
- : $source->result_class->_select_columns);
+ : $source->columns);
$attrs->{select} = [ map { m/\./ ? $_ : "${alias}.$_" } @cols ];
}
$attrs->{as} ||= [ map { m/^$alias\.(.*)$/ ? $1 : $_ } @{$attrs->{select}} ];