From: Dave Rolsky Date: Mon, 10 Nov 2008 23:38:14 +0000 (+0000) Subject: No need to actually get the instance, since we ignore it, but make X-Git-Tag: 0.07~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d07852710cf7d41e14571fbd73b1d8cf0215f798;p=gitmo%2FMooseX-ClassAttribute.git No need to actually get the instance, since we ignore it, but make sure we allow for it in the call to set_value. --- diff --git a/lib/MooseX/ClassAttribute/Role/Meta/Attribute.pm b/lib/MooseX/ClassAttribute/Role/Meta/Attribute.pm index ee3d344..1b1f1b5 100644 --- a/lib/MooseX/ClassAttribute/Role/Meta/Attribute.pm +++ b/lib/MooseX/ClassAttribute/Role/Meta/Attribute.pm @@ -56,15 +56,14 @@ around 'detach_from_class' => sub sub _initialize { my $self = shift; - my $class_name = $self->associated_class()->name(); if ( $self->has_default() ) { - $self->set_value( $class_name, $self->default() ); + $self->set_value( undef, $self->default() ); } elsif ( $self->has_builder() ) { - $self->set_value( $class_name, $self->_call_builder() ); + $self->set_value( undef, $self->_call_builder() ); } } @@ -105,7 +104,7 @@ around 'set_value' => sub { shift; my $self = shift; - my $instance = shift; + shift; # ignoring instance or class name my $value = shift; $self->associated_class()->set_class_attribute_value( $self->name() => $value );