foreach my $method (@methods) {
my $name = $method->name;
- my $attributes = $method->attributes;
+ my $attributes = $method->can('attributes') ? $method->attributes : [];
my $attrs = $self->_parse_attrs( $c, $name, @{ $attributes } );
if ( $attrs->{Private} && ( keys %$attrs > 1 ) ) {
$c->log->debug( 'Bad action definition "'
--- /dev/null
+package TestApp::Controller::Moose::NoAttributes;
+use Moose;
+extends qw/Catalyst::Controller/;
+
+__PACKAGE__->config(
+ actions => {
+ test => { Local => undef }
+ }
+);
+
+sub test {
+}
+
+no Moose;
+1;
+
--- /dev/null
+use strict;
+use Test::More;
+
+{
+ package NoAttributes::CT;
+ use Moose;
+ BEGIN { extends qw/Catalyst::Controller/; };
+
+ sub test {}
+}
+{
+ package NoAttributes::RT;
+ use Moose;
+ extends qw/Catalyst::Controller/;
+
+ sub test {}
+}
+
+foreach my $class (qw/ CT RT /) {
+ my $class_name = 'NoAttributes::' . $class;
+ my $meta = $class_name->meta;
+ my $meth = $meta->find_method_by_name('test');
+ ok $meth->can('attributes'), 'method metaclass has ->attributes method for ' . $class;;
+}
+
+done_testing;
+