Re-register the source (after the added relationship), as this makes the test
Toby Corkindale [Thu, 11 Jun 2009 06:49:56 +0000 (06:49 +0000)]
pass, and is apparently the Right Thing To Do. (See mailing list 09/06/2009)

t/relationship/afterthought.t

index fb2bd82..f4942a3 100644 (file)
@@ -20,6 +20,11 @@ my @previous_rels = sort $schema->source('Artist')->relationships;
 my $class = $schema->class('Artist');
 $class->belongs_to('rank' => $schema->class('Lyrics'));
 
+# Re-register the source:
+$schema->register_extra_source(
+    Artist => $schema->class('Artist')->new->result_source_instance
+);
+
 # Now check we have the relationship:
 my $source = $schema->source('Artist');