fixed SQLite dep and dir copy test failure
[dbsrgits/DBIx-Class-Fixtures.git] / lib / DBIx / Class / Fixtures / Versioned.pm
index 0142814..cdf02d2 100644 (file)
@@ -4,6 +4,7 @@ use strict;
 use warnings;
 
 use base qw/DBIx::Class::Fixtures/;
+use DBIx::Class::Fixtures::SchemaVersioned;
 use Class::C3;
 
 =head1 VERSION
@@ -16,17 +17,11 @@ our $VERSION = '1.000';
 
 =head1 NAME
 
-=head1 SYNOPSIS
+DBIx::Class::Fixtures::Versioned
 
 =head1 DESCRIPTION
 
-=head1 AUTHOR
-
-=head1 CONTRIBUTORS
-
-=head1 METHODS
-
-=head2 new
+Just ignore it for now, but it will vaguely tie in to DBIx::Class::Schema::Versioned's functionality eventually.
 
 =cut
 
@@ -36,9 +31,8 @@ sub populate {
 
   $self->schema_class("DBIx::Class::Fixtures::SchemaVersioned");
   unless ($params->{version}) {
-      return DBIx::Class::Exception->throw('You must pass a version to populate');
+    return DBIx::Class::Exception->throw('You must pass a version to populate');
   }
-
   return $self->next::method(@_);
 }
 
@@ -46,15 +40,13 @@ sub _generate_schema {
   my $self = shift;
   my ($params) = @_;
 
-  my $v = $self->schema_class;
   # manually set the schema version
-  ${$v::VERSION} = $params->{version};
+  $DBIx::Class::Fixtures::SchemaVersioned::VERSION = $params->{version};
 
   my $schema = $self->next::method(@_);
 
   # set the db version to the schema version
-  $schema->upgrade(); # set version number  
-
+  $schema->upgrade(); # set version number
   return $schema;
 }