From: Zbigniew Łukasiak Date: Tue, 17 Nov 2009 16:19:35 +0000 (+0000) Subject: fixed forwarding to application methods (t/aggregate/live_component_controller_action... X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=330b91231edbf5b61375bbda1232674ffa2d1760 fixed forwarding to application methods (t/aggregate/live_component_controller_action_forward.t) --- diff --git a/lib/Catalyst/Dispatcher.pm b/lib/Catalyst/Dispatcher.pm index 4ea6ce1..67adf17 100644 --- a/lib/Catalyst/Dispatcher.pm +++ b/lib/Catalyst/Dispatcher.pm @@ -319,6 +319,10 @@ sub _find_component { sub _invoke_as_component { my ( $self, $c, $component_or_class, $method ) = @_; + if( $component_or_class eq blessed($c->application) ){ + my $possible_action = $c->application->action_for($method); + return $possible_action if $possible_action; + } my $component = $self->_find_component($c, $component_or_class); my $component_class = blessed $component || return 0;