From: Matt S Trout Date: Tue, 8 Aug 2006 11:32:42 +0000 (+0000) Subject: tweaked search_rs to not be destructive to passed X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=888a0746debd73e3aa2bbff0592b8046b7161b94;p=dbsrgits%2FDBIx-Class-Historic.git tweaked search_rs to not be destructive to passed --- diff --git a/lib/DBIx/Class/ResultSet.pm b/lib/DBIx/Class/ResultSet.pm index b6d85b6..a5a6406 100644 --- a/lib/DBIx/Class/ResultSet.pm +++ b/lib/DBIx/Class/ResultSet.pm @@ -172,13 +172,14 @@ sub search_rs { my $our_attrs = { %{$self->{attrs}} }; my $having = delete $our_attrs->{having}; + my $new_attrs = { %{$our_attrs}, %{$attrs} }; + # merge new attrs into inherited foreach my $key (qw/join prefetch/) { next unless exists $attrs->{$key}; - $our_attrs->{$key} = $self->_merge_attr($our_attrs->{$key}, delete $attrs->{$key}); + $new_attrs->{$key} = $self->_merge_attr($our_attrs->{$key}, $attrs->{$key}); } - my $new_attrs = { %{$our_attrs}, %{$attrs} }; my $where = (@_ ? ( (@_ == 1 || ref $_[0] eq "HASH")