No need to actually get the instance, since we ignore it, but make
Dave Rolsky [Mon, 10 Nov 2008 23:38:14 +0000 (23:38 +0000)]
sure we allow for it in the call to set_value.

lib/MooseX/ClassAttribute/Role/Meta/Attribute.pm

index ee3d344..1b1f1b5 100644 (file)
@@ -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 );