Revert r5808 - this is NOT a bug, the warning IS correct
Peter Rabbitson [Sun, 29 Mar 2009 10:06:02 +0000 (10:06 +0000)]
lib/DBIx/Class/Schema.pm

index 413fe78..cf7267d 100644 (file)
@@ -1221,9 +1221,7 @@ calling:
 
 sub register_class {
   my ($self, $moniker, $to_register) = @_;
-  $self->register_source($moniker => $to_register->result_source_instance, {
-    _to_register => $to_register
-  });
+  $self->register_source($moniker => $to_register->result_source_instance);
 }
 
 =head2 register_source
@@ -1281,11 +1279,7 @@ sub _register_source {
 
   if ($source->result_class) {
     my %map = %{$self->class_mappings};
-    my $is_subof = $params->{_to_register} && UNIVERSAL::isa(
-        $params->{_to_register},
-        $source->result_class
-    );
-    if (exists $map{$source->result_class} && !$is_subof) {
+    if (exists $map{$source->result_class}) {
       warn $source->result_class . ' already has a source, use register_extra_source for additional sources';
     }
     $map{$source->result_class} = $moniker;