From: Hans Dieter Pearcey Date: Wed, 24 Jun 2009 20:15:40 +0000 (-0400) Subject: don't override attach_to_class, override install_accessors X-Git-Tag: 0.84~44 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=246bbeef5959385671be705c87715042b049d41d;p=gitmo%2FMoose.git don't override attach_to_class, override install_accessors --- diff --git a/lib/Moose/Meta/Attribute.pm b/lib/Moose/Meta/Attribute.pm index 87e60ed..beb546b 100644 --- a/lib/Moose/Meta/Attribute.pm +++ b/lib/Moose/Meta/Attribute.pm @@ -534,14 +534,15 @@ sub get_value { ## installing accessors -sub attach_to_class { +sub accessor_metaclass { 'Moose::Meta::Method::Accessor' } + +sub install_accessors { my $self = shift; + $self->SUPER::install_accessors(@_); + $self->install_delegation if $self->has_handles; unless ( - $self->has_accessor - || $self->has_reader - || $self->has_writer - || $self->has_handles - # init_arg? + # XXX handles should be in associated_methods + $self->has_handles || @{ $self->associated_methods } || ($self->_is_metadata || '') eq 'bare' ) { @@ -550,15 +551,6 @@ sub attach_to_class { . ' (did you mean to provide an "is" argument?)' ) } - return $self->SUPER::attach_to_class(@_); -} - -sub accessor_metaclass { 'Moose::Meta::Method::Accessor' } - -sub install_accessors { - my $self = shift; - $self->SUPER::install_accessors(@_); - $self->install_delegation if $self->has_handles; return; }