associate methods installed by delegation
Hans Dieter Pearcey [Wed, 24 Jun 2009 21:01:04 +0000 (17:01 -0400)]
lib/Moose/Meta/Attribute.pm

index d5852aa..01cf157 100644 (file)
@@ -541,9 +541,7 @@ sub install_accessors {
     $self->SUPER::install_accessors(@_);
     $self->install_delegation if $self->has_handles;
     unless (
-        # XXX handles should be in associated_methods
-        $self->has_handles
-        || @{ $self->associated_methods }
+        @{ $self->associated_methods }
         || ($self->_is_metadata || '') eq 'bare'
     ) {
         Carp::cluck(
@@ -596,6 +594,7 @@ sub install_delegation {
         my $method = $self->_make_delegation_method($handle, $method_to_call);
 
         $self->associated_class->add_method($method->name, $method);
+        $self->associate_method($method);
     }
 }