From 5a9d5be123f2111da8344d102dcd143a222be2dd Mon Sep 17 00:00:00 2001 From: Alexander Hartmaier Date: Mon, 4 Oct 2010 13:53:33 +0200 Subject: [PATCH] moved relationship_info inside _update_relation instead of passing it around --- lib/DBIx/Class/ResultSet/RecursiveUpdate.pm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/DBIx/Class/ResultSet/RecursiveUpdate.pm b/lib/DBIx/Class/ResultSet/RecursiveUpdate.pm index 04685e7..b9bf433 100644 --- a/lib/DBIx/Class/ResultSet/RecursiveUpdate.pm +++ b/lib/DBIx/Class/ResultSet/RecursiveUpdate.pm @@ -113,8 +113,7 @@ sub recursive_update { $object->$name( $updates->{$name} ) if $object->can($name); } for my $name ( keys %pre_updates ) { - my $info = $object->result_source->relationship_info($name); - _update_relation( $self, $name, $updates->{$name}, $object, $info, + _update_relation( $self, $name, $updates->{$name}, $object, $if_not_submitted ); } @@ -161,8 +160,7 @@ sub recursive_update { } } for my $name ( keys %post_updates ) { - my $info = $object->result_source->relationship_info($name); - _update_relation( $self, $name, $updates->{$name}, $object, $info, + _update_relation( $self, $name, $updates->{$name}, $object, $if_not_submitted ); } return $object; @@ -181,10 +179,12 @@ sub _get_columns_by_accessor { return %columns; } -# Arguments: $name, $updates, $object, $info, $if_not_submitted +# Arguments: $name, $updates, $object, $if_not_submitted sub _update_relation { - my ( $self, $name, $updates, $object, $info, $if_not_submitted ) = @_; + my ( $self, $name, $updates, $object, $if_not_submitted ) = @_; + my $info = $object->result_source->relationship_info($name); + # get a related resultset without a condition my $related_resultset = $self->related_resultset($name)->result_source->resultset; -- 2.45.2