Only register private actions when needed
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Base.pm
index dd93038..35787a4 100644 (file)
@@ -8,12 +8,10 @@ use Catalyst::Utils;
 use Class::Inspector;
 use NEXT;
 
-__PACKAGE__->mk_classdata($_) for qw/_dispatch_steps/;
+__PACKAGE__->mk_classdata($_) for qw/_dispatch_steps _action_class/;
 
 __PACKAGE__->_dispatch_steps( [qw/_BEGIN _AUTO _ACTION/] );
-
-# Fix for stupid components
-*new = \&Catalyst::Component::new;
+__PACKAGE__->_action_class('Catalyst::Action');
 
 sub _DISPATCH : Private {
     my ( $self, $c ) = @_;
@@ -95,7 +93,7 @@ sub register_actions {
             next;
         }
         my $reverse = $namespace ? "$namespace/$method" : $method;
-        my $action = Catalyst::Action->new(
+        my $action = $self->_action_class->new(
             {
                 name       => $method,
                 code       => $code,