Sloppy merge - adding imlari's fix from r5902
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Schema.pm
index d40ef09..2f85adb 100644 (file)
@@ -617,7 +617,7 @@ sub txn_do {
   $self->storage->txn_do(@_);
 }
 
-=head2 txn_scope_guard (EXPERIMENTAL)
+=head2 txn_scope_guard
 
 Runs C<txn_scope_guard> on the schema's storage. See 
 L<DBIx::Class::Storage/txn_scope_guard>.
@@ -1283,7 +1283,13 @@ sub _register_source {
   return if ($params->{extra});
 
   my %map = %{$self->class_mappings};
-  if (exists $map{$rs_class} and $rs_class->result_source_instance ne $orig_source) {
+  if (
+    exists $map{$rs_class}
+      and
+    $map{$rs_class} ne $moniker
+      and
+    $rs_class->result_source_instance ne $orig_source
+  ) {
     carp "$rs_class already has a source, use register_extra_source for additional sources";
   }
   $map{$rs_class} = $moniker;