From: Rafael Kitover Date: Sat, 2 Jan 2010 05:55:35 +0000 (+0000) Subject: fix old class replace regex, new TODO X-Git-Tag: 0.04999_13~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=05e09a8e72aa97efa1b56a0c28e52365bc99d0aa;p=dbsrgits%2FDBIx-Class-Schema-Loader.git fix old class replace regex, new TODO --- diff --git a/TODO-BACKCOMPAT b/TODO-BACKCOMPAT index 08eda1c..17a46d3 100644 --- a/TODO-BACKCOMPAT +++ b/TODO-BACKCOMPAT @@ -1,5 +1,8 @@ SL Backcompat Plan: +* rewrite un-singularized class names (in e.g. custom relationships) in both + preserved custom content and external content from un-singularized classes + * make use_namespaces the default, and upgrade to it properly *** Catalyst Helper diff --git a/lib/DBIx/Class/Schema/Loader/Base.pm b/lib/DBIx/Class/Schema/Loader/Base.pm index 39bb01d..5b334ff 100644 --- a/lib/DBIx/Class/Schema/Loader/Base.pm +++ b/lib/DBIx/Class/Schema/Loader/Base.pm @@ -601,14 +601,14 @@ EOF my $code = do { local ($/, @ARGV) = (undef, $old_real_inc_path); <> }; - $code =~ s/$old_class/$class/g; + $code =~ s/\b$old_class\b/$class/g; eval $code; die $@ if $@; } while(<$fh>) { chomp; - s/$old_class/$class/g; + s/\b$old_class\b/$class/g; $self->_ext_stmt($class, $_); } $self->_ext_stmt($class,