From: Peter Rabbitson Date: Sun, 28 Jun 2009 09:04:26 +0000 (+0000) Subject: Minor omission X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=690c69e4639181658ed17c528eb79f3b0f2d2994;p=dbsrgits%2FDBIx-Class-Historic.git Minor omission --- diff --git a/lib/DBIx/Class/ResultSet.pm b/lib/DBIx/Class/ResultSet.pm index 1524efe..d1db895 100644 --- a/lib/DBIx/Class/ResultSet.pm +++ b/lib/DBIx/Class/ResultSet.pm @@ -2578,16 +2578,17 @@ sub _chain_relationship { # if $self already had a join/prefetch specified on it, the requested # $rel might very well be already included. What we do in this case # is effectively a no-op (except that we bump up the chain_depth on - # the join in question + # the join in question so we could tell it *is* the search_related) my $already_joined; - for my $j (@requested_joins) { + + # we consider the last one thus reverse + for my $j (reverse @requested_joins) { if ($rel eq $j->[0]{-join_path}[-1]) { $j->[0]{-relation_chain_depth}++; $already_joined++; last; } } - unless ($already_joined) { push @$from, $source->_resolve_join($rel, $attrs->{alias}, $seen); }