From: Karen Etheridge Date: Thu, 7 Apr 2011 16:32:31 +0000 (-0700) Subject: don't attempt to wrap a method from MooseX::ClassAttribute if the consuming class... X-Git-Tag: v0.17~6 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMooseX-AlwaysCoerce.git;a=commitdiff_plain;h=418d177d4f460b579609d31d2ae1246bf7093c38 don't attempt to wrap a method from MooseX::ClassAttribute if the consuming class isn't applying that trait. --- diff --git a/lib/MooseX/AlwaysCoerce.pm b/lib/MooseX/AlwaysCoerce.pm index ff7b2c6..8cb3831 100644 --- a/lib/MooseX/AlwaysCoerce.pm +++ b/lib/MooseX/AlwaysCoerce.pm @@ -71,6 +71,9 @@ Use C<< coerce => 0 >> to disable a coercion explicitly. use Moose::Role; use Moose::Util::TypeConstraints; + # MooseX::ClassAttribute is not always present in the consuming class + sub add_class_attribute { } + around add_class_attribute => sub { my $next = shift; my $self = shift;