From: Arthur Axel "fREW" Schmidt Date: Thu, 11 Feb 2010 10:54:49 +0000 (+0000) Subject: make t/76s and t/88 pass by deleting from the correct attr hash X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f0b87b2c979e37d607c819eb4ec13eff93dac573;p=dbsrgits%2FDBIx-Class-Historic.git make t/76s and t/88 pass by deleting from the correct attr hash --- diff --git a/lib/DBIx/Class/ResultSet.pm b/lib/DBIx/Class/ResultSet.pm index 5a94615..0ac9ae7 100644 --- a/lib/DBIx/Class/ResultSet.pm +++ b/lib/DBIx/Class/ResultSet.pm @@ -291,6 +291,10 @@ sub search_rs { $rows = $self->get_cache; } + if (List::Util::first { exists $attrs->{$_} } qw{select as columns}) { + delete $our_attrs->{$_} for (qw{+select +as +columns}); + } + my $new_attrs = { %{$our_attrs}, %{$attrs} }; # merge new attrs into inherited @@ -298,6 +302,7 @@ sub search_rs { next unless exists $attrs->{$key}; $new_attrs->{$key} = $self->_merge_attr($our_attrs->{$key}, $attrs->{$key}); } + my $cond = (@_ ? ( (@_ == 1 || ref $_[0] eq "HASH") @@ -2790,12 +2795,12 @@ sub _resolved_attrs { push @{ $attrs->{select} }, map values %{$_}, @colbits; push @{ $attrs->{as} }, map keys %{$_}, @colbits; - if ( my $adds = $attrs->{'+select'} ) { + if ( my $adds = delete $attrs->{'+select'} ) { $adds = [$adds] unless ref $adds eq 'ARRAY'; push @{ $attrs->{select} }, map { /\./ || ref $_ ? $_ : "$alias.$_" } @$adds; } - if ( my $adds = $attrs->{'+as'} ) { + if ( my $adds = delete $attrs->{'+as'} ) { $adds = [$adds] unless ref $adds eq 'ARRAY'; push @{ $attrs->{as} }, @$adds; }