makes search_related on extended rels without the optimized version work. involves...
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / ResultSource.pm
index fecbbb7..3e74860 100644 (file)
@@ -1568,12 +1568,11 @@ sub _resolve_condition {
       $self->throw_exception ('Unable to determine relationship name for condition resolution');
     }
 
-    $cond = $cond->(
-      $for,
-      ref $for ? 'me' : $as,
-      $self,
-      $rel,
-    );
+    return $cond->(ref $for ? $as : $for,
+                   ref $for ? 'me' : $as,
+                   $self,
+                   $rel,
+                   ref $for ? $for : undef);
 
   } elsif (ref $cond eq 'HASH') {
     my %ret;