replacing ::Base with ::Compat now, instead of just unshifting to @ISA, t/backcompat...
Rafael Kitover [Thu, 24 Dec 2009 06:49:54 +0000 (06:49 +0000)]
TODO-BACKCOMPAT
lib/DBIx/Class/Schema/Loader/Base.pm
lib/DBIx/Class/Schema/Loader/Compat/v0_040.pm

index 08b4a54..5b50091 100644 (file)
@@ -14,13 +14,9 @@ SL Backcompat Plan:
 *** backcompat tests
 
 These are still failing:
-* t/backcompat/0.04006/20invocations.t
 * t/backcompat/0.04006/23dumpmore.t
 
-*** naming accessor
-
-* class data for Loader
-* passed to _loader->new
+Need a comprehensive backcompat.t
 
 *** Write ::Manual::UpgradingFrom0.04006 POD
 
index 64a9a6c..141643c 100644 (file)
@@ -343,8 +343,13 @@ sub _check_back_compat {
         no strict 'refs';
         my $class = ref $self || $self;
         require DBIx::Class::Schema::Loader::Compat::v0_040;
-        unshift @{"${class}::ISA"},
-            'DBIx::Class::Schema::Loader::Compat::v0_040';
+
+        @{"${class}::ISA"} = map {
+            $_ eq 'DBIx::Class::Schema::Loader::Base' ?
+                'DBIx::Class::Schema::Loader::Compat::v0_040' :
+                $_
+        } @{"${class}::ISA"};
+
         Class::C3::reinitialize;
 # just in case, though no one is likely to dump a dynamic schema
         $self->schema_version_to_dump('0.04006');
@@ -367,7 +372,12 @@ sub _check_back_compat {
                 if ($self->load_optional_class($compat_class)) {
                     no strict 'refs';
                     my $class = ref $self || $self;
-                    unshift @{"${class}::ISA"}, $compat_class;
+
+                    @{"${class}::ISA"} = map {
+                        $_ eq 'DBIx::Class::Schema::Loader::Base' ?
+                            $compat_class : $_
+                    } @{"${class}::ISA"};
+
                     Class::C3::reinitialize;
                     $self->schema_version_to_dump($real_ver);
                     last;
index 63dd8db..1af1647 100644 (file)
@@ -3,6 +3,9 @@ package DBIx::Class::Schema::Loader::Compat::v0_040;
 use strict;
 use warnings;
 use Class::C3;
+
+use base 'DBIx::Class::Schema::Loader::Base';
+
 use DBIx::Class::Schema::Loader::RelBuilder::Compat::v0_040;
 
 # Make a moniker from a table