From: Luke Saunders Date: Thu, 31 Jul 2008 18:26:59 +0000 (+0000) Subject: switched to just registering extra source rather than removing and reregistering X-Git-Tag: v0.08240~388 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=95120bb5264aa779fa2da55be3b44f5cc9c08736;p=dbsrgits%2FDBIx-Class.git switched to just registering extra source rather than removing and reregistering --- diff --git a/lib/DBIx/Class/Schema.pm b/lib/DBIx/Class/Schema.pm index 7f7fb37..ee13a1d 100644 --- a/lib/DBIx/Class/Schema.pm +++ b/lib/DBIx/Class/Schema.pm @@ -913,8 +913,9 @@ sub clone { foreach my $moniker ($self->sources) { my $source = $self->source($moniker); my $new = $source->new($source); - $clone->_unregister_source($moniker); - $clone->register_source($moniker => $new); + # we use extra here as we want to leave the class_mappings as they are + # but overwrite the source_registrations entry with the new source + $clone->register_extra_source($moniker => $new); } $clone->storage->set_schema($clone) if $clone->storage; return $clone;