argh. stupidity attack.
Matt S Trout [Thu, 22 Jun 2006 14:51:40 +0000 (14:51 +0000)]
r10056@cain (orig r4393):  matthewt | 2006-06-17 16:22:26 +0000

lib/Catalyst/ActionChain.pm

index ceb7c81..6b08e2b 100644 (file)
@@ -49,7 +49,9 @@ actions in order.
 sub dispatch {
     my ( $self, $c ) = @_;
     my @captures = @{$c->req->captures||[]};
-    foreach my $action ( @{ $self->chain } ) {
+    my @chain = @{ $self->chain };
+    my $last = pop(@chain);
+    foreach my $action ( @chain ) {
         my @args;
         if (my $cap = $action->attributes->{Captures}) {
           @args = splice(@captures, 0, $cap->[0]);
@@ -57,6 +59,7 @@ sub dispatch {
         local $c->request->{arguments} = \@args;
         $action->dispatch( $c );
     }
+    $last->dispatch( $c );
 }
 
 =head2 from_chain( \@actions )