forwarding to "AppTest" without action should go to the "process" method
Zbigniew Łukasiak [Wed, 18 Nov 2009 21:32:02 +0000 (21:32 +0000)]
lib/Catalyst/Dispatcher.pm

index 67adf17..d5d8375 100644 (file)
@@ -322,6 +322,19 @@ sub _invoke_as_component {
     if( $component_or_class eq blessed($c->application) ){ 
         my $possible_action = $c->application->action_for($method); 
         return $possible_action if $possible_action; 
+        if( my $code = $c->application->can($method) ){ 
+  return $self->_method_action_class->new( 
+  { 
+  name => $method, 
+  code => $code, 
+  reverse => "$component_or_class->$method", 
+  class => $component_or_class, 
+  namespace => Catalyst::Utils::class2prefix( 
+  $component_or_class
+  ), 
+  } 
+  ); 
+  } 
     } 
     my $component = $self->_find_component($c, $component_or_class);
     my $component_class = blessed $component || return 0;