Switch code/documentation/examples/tests to the new single-arg syntax
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / ResultSource.pm
index fecbbb7..e5fb395 100644 (file)
@@ -1568,12 +1568,13 @@ 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->({
+      self_alias => ref $for ? $as : $for,
+      foreign_alias => ref $for ? $self->related_source($rel)->resultset->current_source_alias : $as,
+      self_resultsource => $self,
+      foreign_relname => $rel,
+      self_rowobj => ref $for ? $for : undef
+    });
 
   } elsif (ref $cond eq 'HASH') {
     my %ret;