From: Karen Etheridge Date: Fri, 10 Jun 2011 22:56:47 +0000 (+0000) Subject: Revert "better check for if add_class_attribute is present." X-Git-Tag: v0.17~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e67377679d963a2b655d03eda11e9cd227c922e6;p=gitmo%2FMooseX-AlwaysCoerce.git Revert "better check for if add_class_attribute is present." This reverts commit 620f60fd8297bf2ccfde2f391f9ebb63a74af18b. The method won't be present in this package -- this is a role!! --- diff --git a/lib/MooseX/AlwaysCoerce.pm b/lib/MooseX/AlwaysCoerce.pm index 5ab21f1..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; @@ -82,9 +85,7 @@ Use C<< coerce => 0 >> to disable a coercion explicitly. } $self->$next($what, %opts); - } - # MooseX::ClassAttribute is not always present in the consuming class/role - if __PACKAGE__->meta->has_method('add_class_attribute'); + }; } my (undef, undef, $init_meta) = Moose::Exporter->build_import_methods(