Make go('/chained/action') execute the full chain, not just the endpoint.
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Dispatcher.pm
index b4e3dc2..91ae6fc 100644 (file)
@@ -178,6 +178,8 @@ sub go {
         return 0;
     }
 
+    $action = $self->expand_action($action);
+
     local $c->request->{arguments} = $args;
     $c->namespace($action->namespace);
     $c->action($action);
@@ -421,6 +423,17 @@ sub uri_for_action {
     return undef;
 }
 
+sub expand_action {
+    my ($self, $action) = @_;
+
+    foreach my $dispatch_type (@{ $self->_dispatch_types }) {
+        my $expanded = $dispatch_type->expand_action($action);
+        return $expanded if $expanded;
+    }
+
+    return $action;
+}
+
 =head2 $self->register( $c, $action )
 
 Make sure all required dispatch types for this action are loaded, then