fix old class replace regex, new TODO
Rafael Kitover [Sat, 2 Jan 2010 05:55:35 +0000 (05:55 +0000)]
TODO-BACKCOMPAT
lib/DBIx/Class/Schema/Loader/Base.pm

index 08eda1c..17a46d3 100644 (file)
@@ -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
index 39bb01d..5b334ff 100644 (file)
@@ -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,