From: Peter Rabbitson Date: Fri, 7 Nov 2008 07:30:49 +0000 (+0000) Subject: Fix loss of objects on multicreate over several 1:M relations X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e912f5f094315b0b5370ad3c9be58817cdf55256;p=dbsrgits%2FDBIx-Class-Historic.git Fix loss of objects on multicreate over several 1:M relations --- diff --git a/lib/DBIx/Class/Row.pm b/lib/DBIx/Class/Row.pm index e57699c..0d08638 100644 --- a/lib/DBIx/Class/Row.pm +++ b/lib/DBIx/Class/Row.pm @@ -302,7 +302,7 @@ sub insert { my $reverse = $source->reverse_relationship_info($relname); foreach my $obj (@cands) { $obj->set_from_related($_, $self) for keys %$reverse; - my $them = { $obj->get_inflated_columns }; + my $them = { %{$obj->{_relationship_data} || {} }, $obj->get_inflated_columns }; if ($self->__their_pk_needs_us($relname, $them)) { $obj = $self->find_or_create_related($relname, $them); } else {