documention for cpan release
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Dispatcher.pm
index 12040b2..46f41f8 100644 (file)
@@ -273,6 +273,7 @@ Documented in L<Catalyst>
 sub detach {
     my ( $self, $c, $command, @args ) = @_;
     $self->_do_forward(detach => $c, $command, @args ) if $command;
+    $c->state(0); # Needed in order to skip any auto functions
     Catalyst::Exception::Detach->throw;
 }
 
@@ -614,6 +615,7 @@ sub setup_actions {
     @{ $self->_registered_dispatch_types }{@classes} = (1) x @classes;
 
     foreach my $comp ( values %{ $c->components } ) {
+        $comp = $comp->() if ref($comp) eq 'CODE';
         $comp->register_actions($c) if $comp->can('register_actions');
     }