added Catalyst::Component->action_for
[catagits/Catalyst-Runtime.git] / lib / Catalyst / DispatchType / Default.pm
index f1864b2..58779fa 100644 (file)
@@ -17,6 +17,9 @@ See L<Catalyst>.
 
 =head2 $self->match( $c, $path )
 
+Check if default action matches, and set action if it does. 
+Will be called last for each controller.
+
 =cut
 
 sub match {
@@ -25,7 +28,7 @@ sub match {
     my $result = ( $c->get_actions( 'default', $c->req->path ) )[-1];
 
     # Find default on namespace or super
-    if ($result) {
+    if ($result && $result->match($c)) {
         $c->action($result);
         $c->namespace( $result->namespace );
         $c->req->action('default');