Revert "better check for if add_class_attribute is present."
[gitmo/MooseX-AlwaysCoerce.git] / lib / MooseX / AlwaysCoerce.pm
index 5ab21f1..8cb3831 100644 (file)
@@ -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(