switch binding to use value_path
Matt S Trout [Wed, 16 Mar 2016 16:34:47 +0000 (16:34 +0000)]
lib/DX/ActionBuilder/Null.pm
lib/DX/ActionBuilder/UnsetValue.pm

index 0ac25b7..b7b2738 100644 (file)
@@ -6,6 +6,12 @@ with 'DX::Role::ActionBuilder';
 
 has target_path => (is => 'ro');
 
+around target_path => sub {
+  my ($orig, $self) = (shift, shift);
+  return undef unless ref($self);
+  return $self->$orig(@_);
+};
+
 sub can_set_value { 0 }
 
 sub action_for_set_value { undef }
index 95eecf5..1a0a791 100644 (file)
@@ -12,7 +12,7 @@ has target_path => (is => 'ro', required => 1);
 
 sub action_for_set_value {
   my ($self, $value) = @_;
-  if (my $p = $value->identity_path) {
+  if (my $p = $value->value_path) {
     my $ab = DX::ActionBuilder::BoundValue->new(
       target_path => $self->target_path,
       rebind_path => $self->target_path,