Alter register_extra_source() to _unregister_source() and register_source() abandoned/runtime_added_relships
Toby Corkindale [Thu, 11 Jun 2009 07:21:20 +0000 (07:21 +0000)]
t/relationship/afterthought.t

index f4942a3..7965b2a 100644 (file)
@@ -21,9 +21,13 @@ 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
-);
+{
+    my $class = $schema->class('Artist');
+    $schema->_unregister_source('Artist');
+    $schema->register_source(
+        Artist => $class->new->result_source_instance
+    );
+}
 
 # Now check we have the relationship:
 my $source = $schema->source('Artist');