Fix to cascade_delete courtesy mst.
Simon Elliott [Tue, 4 Apr 2006 12:52:56 +0000 (12:52 +0000)]
lib/DBIx/Class/Relationship/CascadeActions.pm

index e4564c1..439cfde 100644 (file)
@@ -17,7 +17,7 @@ sub delete {
   my %rels = map { $_ => $source->relationship_info($_) } $source->relationships;
   my @cascade = grep { $rels{$_}{attrs}{cascade_delete} } keys %rels;
   foreach my $rel (@cascade) {
-    $self->search_related($rel)->delete;
+    $self->search_related($rel)->delete_all;
   }
   return $ret;
 }