From: Matt S Trout Date: Wed, 16 Mar 2016 16:34:47 +0000 (+0000) Subject: switch binding to use value_path X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e1bcd735fd148db697561a6e4a15e5484f37f468;p=scpubgit%2FDX.git switch binding to use value_path --- diff --git a/lib/DX/ActionBuilder/Null.pm b/lib/DX/ActionBuilder/Null.pm index 0ac25b7..b7b2738 100644 --- a/lib/DX/ActionBuilder/Null.pm +++ b/lib/DX/ActionBuilder/Null.pm @@ -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 } diff --git a/lib/DX/ActionBuilder/UnsetValue.pm b/lib/DX/ActionBuilder/UnsetValue.pm index 95eecf5..1a0a791 100644 --- a/lib/DX/ActionBuilder/UnsetValue.pm +++ b/lib/DX/ActionBuilder/UnsetValue.pm @@ -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,