From: Luke Saunders Date: Tue, 2 Oct 2007 15:38:21 +0000 (+0000) Subject: fixed find_or_new_related bug X-Git-Tag: v0.08010~59 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=29cfcca227a84f62f8d11a7fc582430c84050d20;p=dbsrgits%2FDBIx-Class.git fixed find_or_new_related bug --- diff --git a/lib/DBIx/Class/ResultSet.pm b/lib/DBIx/Class/ResultSet.pm index 713bf14..9da6a14 100644 --- a/lib/DBIx/Class/ResultSet.pm +++ b/lib/DBIx/Class/ResultSet.pm @@ -1450,8 +1450,8 @@ sub new_result { my $alias = $self->{attrs}{alias}; my $collapsed_cond = $self->{cond} ? $self->_collapse_cond($self->{cond}) : {}; my %new = ( - %{ $self->_remove_alias($values, $alias) }, %{ $self->_remove_alias($collapsed_cond, $alias) }, + %{ $self->_remove_alias($values, $alias) }, -source_handle => $self->_source_handle, -result_source => $self->result_source, # DO NOT REMOVE THIS, REQUIRED ); diff --git a/t/66relationship.t b/t/66relationship.t index 1711c30..1d416ab 100644 --- a/t/66relationship.t +++ b/t/66relationship.t @@ -122,7 +122,6 @@ $cd->result_source->schema->storage->debug(0); is($newartist->name, 'Random Boy Band Two', 'find_or_new_related new artist record with id'); is($newartist->id, 200, 'find_or_new_related new artist id set'); - SKIP: { skip "relationship checking needs fixing", 1; # try to add a bogus relationship using the wrong cols diff --git a/t/96multi_create.t b/t/96multi_create.t index 9c5522b..4596cda 100644 --- a/t/96multi_create.t +++ b/t/96multi_create.t @@ -173,8 +173,7 @@ my $new_cd_hashref = { my $cd = $schema->resultset("CD")->find(1); -print $cd->artist->id; is($cd->artist->id, 1, 'rel okay'); my $new_cd = $schema->resultset("CD")->create($new_cd_hashref); -is($new_cd->artist->id, 17, 'new id retained okay'); \ No newline at end of file +is($new_cd->artist->id, 17, 'new id retained okay');