[Bast-commits] r7993 - branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader

caelum at dev.catalyst.perl.org caelum at dev.catalyst.perl.org
Mon Nov 30 13:51:11 GMT 2009


Author: caelum
Date: 2009-11-30 13:51:11 +0000 (Mon, 30 Nov 2009)
New Revision: 7993

Modified:
   branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/Base.pm
Log:
set old version only on Schema.pm in backcompat mode

Modified: branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/Base.pm
===================================================================
--- branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/Base.pm	2009-11-30 09:07:49 UTC (rev 7992)
+++ branches/DBIx-Class-Schema-Loader/back-compat/lib/DBIx/Class/Schema/Loader/Base.pm	2009-11-30 13:51:11 UTC (rev 7993)
@@ -53,6 +53,7 @@
 
 __PACKAGE__->mk_accessors(qw/
                                 version_to_dump
+                                schema_version_to_dump
 /);
 
 =head1 NAME
@@ -327,6 +328,7 @@
     $self->{dump_directory} ||= $self->{temp_directory};
 
     $self->version_to_dump($DBIx::Class::Schema::Loader::VERSION);
+    $self->schema_version_to_dump($DBIx::Class::Schema::Loader::VERSION);
 
     $self->_check_back_compat;
 
@@ -345,7 +347,7 @@
             'DBIx::Class::Schema::Loader::Compat::v0_040';
         Class::C3::reinitialize;
 # just in case, though no one is likely to dump a dynamic schema
-        $self->version_to_dump('0.04006');
+        $self->schema_version_to_dump('0.04006');
         return;
     }
 
@@ -367,7 +369,7 @@
                     my $class = ref $self || $self;
                     unshift @{"${class}::ISA"}, $compat_class;
                     Class::C3::reinitialize;
-                    $self->version_to_dump($real_ver);
+                    $self->schema_version_to_dump($real_ver);
                     last;
                 }
                 $ver =~ s/\d\z// or last;
@@ -663,7 +665,10 @@
         $schema_text .= qq|__PACKAGE__->load_classes;\n|;
     }
 
-    $self->_write_classfile($schema_class, $schema_text);
+    {
+        local $self->{version_to_dump} = $self->schema_version_to_dump;
+        $self->_write_classfile($schema_class, $schema_text);
+    }
 
     my $result_base_class = $self->result_base_class || 'DBIx::Class';
 




More information about the Bast-commits mailing list