X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst%2FActionContainer.pm;h=e8f71fe3dcdfd053130cf642165c7fefbe4b95ce;hp=2e711d4d500a451ddc469b497140283def1c9e71;hb=807303a1658f895c41417beba24d24ff9b71c194;hpb=531f1ab6f98c126f57075dbbca4884ac9728703c diff --git a/lib/Catalyst/ActionContainer.pm b/lib/Catalyst/ActionContainer.pm index 2e711d4..e8f71fe 100644 --- a/lib/Catalyst/ActionContainer.pm +++ b/lib/Catalyst/ActionContainer.pm @@ -21,9 +21,10 @@ with 'MooseX::Emulate::Class::Accessor::Fast'; has part => (is => 'rw', required => 1); has actions => (is => 'rw', required => 1, lazy => 1, default => sub { {} }); -around new => sub { - my ($orig, $self, $params) = @_; - $orig->($self, (ref($params) ? $params : { part => $params } )); +around BUILDARGS => sub { + my ($next, $self, @args) = @_; + unshift @args, 'part' if scalar @args == 1 && !ref $args[0]; + return $self->$next(@args); }; no Moose; @@ -86,7 +87,7 @@ Catalyst Contributors, see Catalyst.pm =head1 COPYRIGHT -This program is free software, you can redistribute it and/or modify it under +This library is free software. You can redistribute it and/or modify it under the same terms as Perl itself. =cut