tests and patch for Controller to accept action_args from constructor
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Controller.pm
index 1442649..a6bba64 100644 (file)
@@ -36,6 +36,8 @@ has actions =>
      init_arg => undef,
     );
 
+has action_args => (is => 'ro');
+
 # ->config(actions => { '*' => ...
 has _all_actions_attributes => (
     is       => 'ro',
@@ -279,7 +281,11 @@ sub create_action {
     my %args = @_;
 
     my $class = $self->action_class(%args);
-    my $action_args = $self->config->{action_args};
+    my $action_args = (
+        ref($self)
+            ? $self->action_args
+            : $self->config->{action_args}
+    );
 
     my %extra_args = (
         %{ $action_args->{'*'}           || {} },