From: Zbigniew Łukasiak Date: Wed, 18 Nov 2009 21:32:02 +0000 (+0000) Subject: forwarding to "AppTest" without action should go to the "process" method X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=bbc249c902428383aca5a470c40ad4c646158ead forwarding to "AppTest" without action should go to the "process" method --- diff --git a/lib/Catalyst/Dispatcher.pm b/lib/Catalyst/Dispatcher.pm index 67adf17..d5d8375 100644 --- a/lib/Catalyst/Dispatcher.pm +++ b/lib/Catalyst/Dispatcher.pm @@ -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;