$pre_source, @{$pre_rec}));
}
$new->related_resultset($pre)->set_cache(\@pre_objects);
- } else {
+ } elsif (defined $pre_val->[0]) {
my $fetched;
unless ($pre_source->primary_columns == grep { exists $pre_val->[0]{$_}
and !defined $pre_val->[0]{$_} } $pre_source->primary_columns)
eval "use DBD::SQLite";
plan skip_all => 'needs DBD::SQLite for testing' if $@;
-plan tests => 14;
+plan tests => 15;
my $rs = $schema->resultset("Artist")->search(
{ artistid => 1 }
},
}
);
+{
+$schema->resultset("Artist")->create({artistid=>4,name=>qq{Humoungous Hamsters}});
+my $artist = $schema->resultset("Artist")->search(
+ { artistid => 4 },{prefetch=>[qw/cds/]}
+)->first;
+
+is($artist->cds, 0, 'No cds for this artist');
+}
# SELECT count for nested has_many prefetch
unlink 't/var/dbic.trace' if -e 't/var/dbic.trace';