Even though I personally added these in 4f8c9678 I no longer recall why
[dbsrgits/DBIx-Class-Historic.git] / lib / DBIx / Class / ResultSource.pm
index 3c45662..1b97e22 100644 (file)
@@ -1715,7 +1715,11 @@ sub _resolve_join {
                -alias => $as,
                -relation_chain_depth => ( $seen->{-relation_chain_depth} || 0 ) + 1,
              },
-             scalar $self->_resolve_condition($rel_info->{cond}, $as, $alias, $join)
+             $self->_resolve_relationship_condition(
+               rel_name => $join,
+               self_alias => $alias,
+               foreign_alias => $as,
+             )->{condition},
           ];
   }
 }
@@ -1919,12 +1923,9 @@ sub _resolve_relationship_condition {
     )
   ;
 
-#TEMP
-  my $rel_rsrc;# = $self->related_source($args->{rel_name});
+  my $rel_rsrc = $self->related_source($args->{rel_name});
 
   if (exists $args->{foreign_values}) {
-# TEMP
-    $rel_rsrc ||= $self->related_source($args->{rel_name});
 
     if (defined blessed $args->{foreign_values}) {
 
@@ -1987,9 +1988,6 @@ sub _resolve_relationship_condition {
         "The join-free condition returned for $exception_rel_id must be a hash reference"
       ) unless ref $jfc eq 'HASH';
 
-# TEMP
-      $rel_rsrc ||= $self->related_source($args->{rel_name});
-
       my ($joinfree_alias, $joinfree_source);
       if (defined $args->{self_result_object}) {
         $joinfree_alias = $args->{foreign_alias};
@@ -2184,9 +2182,6 @@ sub _resolve_relationship_condition {
 
       next if $col_eqs->{$lhs} eq UNRESOLVABLE_CONDITION;
 
-# TEMP
-      $rel_rsrc ||= $self->related_source($args->{rel_name});
-
       # there is no way to know who is right and who is left in a cref
       # therefore a full blown resolution call, and figure out the
       # direction a bit further below