fixed failing extra_source test
Luke Saunders [Wed, 6 Aug 2008 18:32:00 +0000 (18:32 +0000)]
lib/DBIx/Class/Schema.pm

index ae4f977..94bc72d 100644 (file)
@@ -132,12 +132,11 @@ sub _register_source {
 
   $source->schema($self);
 
-  return if ($params->{extra});
-
   weaken($source->{schema}) if ref($self);
   if ($source->result_class) {
     my %map = %{$self->class_mappings};
     if (exists $map{$source->result_class}) {
+      return if ($params->{extra});
       warn $source->result_class . ' already has a source, use register_extra_source for additional sources';
     }
     $map{$source->result_class} = $moniker;