update distar url
[catagits/Catalyst-Runtime.git] / lib / Catalyst / DispatchType / Index.pm
index d55ca00..6bad124 100644 (file)
@@ -67,7 +67,7 @@ Register an action with this DispatchType.
 sub register {
     my ( $self, $c, $action ) = @_;
 
-    $self->_actions->{ $action->reverse } = $action;
+    $self->_actions->{ $action->reverse } = $action if $action->name eq 'index';
 
     return 1;
 }
@@ -84,11 +84,13 @@ sub uri_for_action {
 
     return undef if @$captures;
 
-    return undef unless $action->name eq 'index';
+    return undef unless exists $self->_actions->{ $action->reverse };
 
     return "/".$action->namespace;
 }
 
+sub _is_low_precedence { 1 }
+
 =head1 AUTHORS
 
 Catalyst Contributors, see Catalyst.pm