From: Jason M. Mills Date: Wed, 8 Apr 2009 19:26:57 +0000 (+0000) Subject: patch for no-op, further testing required. X-Git-Tag: v0.08101~12^2~5 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6d4f9d9435df40f0557a7875b2929d5de3070fe5;p=dbsrgits%2FDBIx-Class.git patch for no-op, further testing required. --- diff --git a/lib/DBIx/Class/Schema.pm b/lib/DBIx/Class/Schema.pm index cf7267d..740c5c0 100644 --- a/lib/DBIx/Class/Schema.pm +++ b/lib/DBIx/Class/Schema.pm @@ -1267,6 +1267,7 @@ sub register_extra_source { sub _register_source { my ($self, $moniker, $source, $params) = @_; + my $orig_source = $source; $source = $source->new({ %$source, source_name => $moniker }); my %reg = %{$self->source_registrations}; @@ -1279,7 +1280,7 @@ sub _register_source { if ($source->result_class) { my %map = %{$self->class_mappings}; - if (exists $map{$source->result_class}) { + if (exists $map{$source->result_class} && $orig_source ne $source->result_class->result_source_instance) { warn $source->result_class . ' already has a source, use register_extra_source for additional sources'; } $map{$source->result_class} = $moniker;