From: Rafael Kitover Date: Wed, 7 Sep 2011 11:07:26 +0000 (-0400) Subject: fix backcompat X-Git-Tag: 0.07011~43 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0dd6956db88740a69000a0404c16221e8cebf8fb;p=dbsrgits%2FDBIx-Class-Schema-Loader.git fix backcompat Fixes generating the old moniker when upgrading from a previous code version (v4 unsingularized monikers -> singularized.) t/25backcompat.t passes again. --- diff --git a/lib/DBIx/Class/Schema/Loader/Base.pm b/lib/DBIx/Class/Schema/Loader/Base.pm index 4eae9fb..51eb81e 100644 --- a/lib/DBIx/Class/Schema/Loader/Base.pm +++ b/lib/DBIx/Class/Schema/Loader/Base.pm @@ -1992,7 +1992,12 @@ sub _make_src_class { ); } - my $old_class = join(q{::}, @result_namespace, $table_moniker); + my $old_table_moniker = do { + local $self->naming->{monikers} = $upgrading_v; + $self->_table2moniker($table); + }; + + my $old_class = join(q{::}, @result_namespace, $old_table_moniker); $self->_upgrading_classes->{$table_class} = $old_class unless $table_class eq $old_class;