defined $self->{cond}
&& $self->{cond} eq $DBIx::Class::ResultSource::UNRESOLVABLE_CONDITION
) {
- %new = %{$self->{attrs}{related_objects}};
+ %new = %{ $self->{attrs}{related_objects} || {} }; # nothing might have been inserted yet
$new{-from_resultset} = [ keys %new ] if keys %new;
} else {
$self->throw_exception(
my $schema = DBICTest->init_schema();
-plan tests => 69;
+plan tests => 70;
# has_a test
my $cd = $schema->resultset("CD")->find(4);
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');
+lives_ok(
+ sub {
+ my $new_bookmark = $schema->resultset("Bookmark")->new_result( {} );
+ my $new_related_link = $new_bookmark->new_related( 'link', {} );
+ },
+ 'No back rel'
+);
+
+
TODO: {
local $TODO = "relationship checking needs fixing";
# try to add a bogus relationship using the wrong cols