From: Matt S Trout Date: Fri, 11 May 2007 03:44:20 +0000 (+0000) Subject: minor fixup to bulk_create X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=df78aeb129f7e803948e715e3a4051c94eeb529e;p=dbsrgits%2FDBIx-Class-Historic.git minor fixup to bulk_create --- diff --git a/lib/DBIx/Class/Row.pm b/lib/DBIx/Class/Row.pm index b162dd2..9e6faad 100644 --- a/lib/DBIx/Class/Row.pm +++ b/lib/DBIx/Class/Row.pm @@ -97,8 +97,8 @@ sub new { ## 'filter' should disappear and get merged in with 'single' above! my $rel_obj = delete $attrs->{$key}; if(!Scalar::Util::blessed($rel_obj)) { - $rel_obj = $new->new_related($key, $rel_obj); - $new->{_rel_in_storage} = 0; + $rel_obj = $new->find_or_new_related($key, $rel_obj); + $new->{_rel_in_storage} = 0 unless ($rel_obj->in_storage); } $inflated->{$key} = $rel_obj; next;