From: Rafael Kitover Date: Fri, 18 Nov 2011 17:03:24 +0000 (-0500) Subject: make copy of moniker_parts in disambiguation code X-Git-Tag: 0.07014~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c5694be02da2568645458e0a014eb3db15c3936a;p=dbsrgits%2FDBIx-Class-Schema-Loader.git make copy of moniker_parts in disambiguation code The local $self->{moniker_parts} code did not make a copy of $self->moniker_parts before unshifting to it, so modifications were made to the original reference, breaking ->rescan. --- diff --git a/Changes b/Changes index 905327e..6dacb70 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,8 @@ Revision history for Perl extension DBIx::Class::Schema::Loader + - fix a bug in the automatic multischema clashing moniker disambiguation + code that overwrote $loader->moniker_parts + 0.07013 2011-11-17 23:12:47 - automatically prefix database/schema to clashing monikers for the same table name in multischema configurations diff --git a/lib/DBIx/Class/Schema/Loader/Base.pm b/lib/DBIx/Class/Schema/Loader/Base.pm index a2f1218..eecd552 100644 --- a/lib/DBIx/Class/Schema/Loader/Base.pm +++ b/lib/DBIx/Class/Schema/Loader/Base.pm @@ -1515,7 +1515,7 @@ sub _load_tables { delete $self->monikers->{$_->sql_name} for @$tables; - my $moniker_parts = $self->{moniker_parts}; + my $moniker_parts = [ @{ $self->moniker_parts } ]; my $have_schema = 1 if any { $_ eq 'schema' } @{ $self->moniker_parts }; my $have_database = 1 if any { $_ eq 'database' } @{ $self->moniker_parts };