fixed forwarding to application methods (t/aggregate/live_component_controller_action...
Zbigniew Łukasiak [Tue, 17 Nov 2009 16:19:35 +0000 (16:19 +0000)]
lib/Catalyst/Dispatcher.pm

index 4ea6ce1..67adf17 100644 (file)
@@ -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;