From: Luke Saunders Date: Fri, 1 Aug 2008 11:29:34 +0000 (+0000) Subject: fixed clone bug X-Git-Tag: v0.08240~387 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=73529292bc176d1f216e1020c07ac81e986a1639;p=dbsrgits%2FDBIx-Class.git fixed clone bug --- diff --git a/Changes b/Changes index f08a7f3..05e2fad 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,8 @@ Revision history for DBIx::Class 0.08099_04 2008-07-24 01:00:00 + - Fixed $schema->clone bug which caused clone and source to share + internal hash refs - Added register_extra_source methods for additional sources - Added datetime_undef_if_invalid for InflateColumn::DateTime to return undef on invalid date/time values diff --git a/lib/DBIx/Class/Schema.pm b/lib/DBIx/Class/Schema.pm index ee13a1d..ae4f977 100644 --- a/lib/DBIx/Class/Schema.pm +++ b/lib/DBIx/Class/Schema.pm @@ -910,6 +910,8 @@ sub clone { my $clone = { (ref $self ? %$self : ()) }; bless $clone, (ref $self || $self); + $clone->class_mappings({ %{$clone->class_mappings} }); + $clone->source_registrations({ %{$clone->source_registrations} }); foreach my $moniker ($self->sources) { my $source = $self->source($moniker); my $new = $source->new($source);