From: Matt S Trout Date: Mon, 10 Jul 2006 01:07:16 +0000 (+0000) Subject: back to less failures X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0e444f7f5a6b29623cc2b0e9ebf8fbfce7a4cf80;p=dbsrgits%2FDBIx-Class-Historic.git back to less failures --- diff --git a/lib/DBIx/Class/ResultSet.pm b/lib/DBIx/Class/ResultSet.pm index 56dac88..689586f 100644 --- a/lib/DBIx/Class/ResultSet.pm +++ b/lib/DBIx/Class/ResultSet.pm @@ -195,12 +195,6 @@ sub search_rs { $our_attrs->{join}, $attrs->{_live_join_h} ) if ($attrs->{_live_join_h}); - if (defined $our_attrs->{prefetch}) { - $our_attrs->{join} = $self->_merge_attr( - $our_attrs->{join}, $our_attrs->{prefetch} - ); - } - my $new_attrs = { %{$our_attrs}, %{$attrs} }; my $where = (@_ ? ( @@ -745,7 +739,16 @@ sub _resolved_attrs { $attrs->{from} ||= [ { $alias => $source->from } ]; $attrs->{seen_join} ||= {}; - if (my $join = delete $attrs->{join}) { + if (exists $attrs->{join} || exists $attrs->{prefetch}) { + + my $join = delete $attrs->{join} || {}; + + if (defined $attrs->{prefetch}) { + $join = $self->_merge_attr( + $join, $attrs->{prefetch} + ); + } + push(@{$attrs->{from}}, $source->resolve_join($join, $alias, $attrs->{seen_join}) );