From: Luke Saunders Date: Fri, 1 Feb 2008 22:20:17 +0000 (+0000) Subject: fixed ::Versioned class X-Git-Tag: v1.001002~49 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9f96b203ed72d410bcb55a41b2d504eb5d8507d1;p=dbsrgits%2FDBIx-Class-Fixtures.git fixed ::Versioned class --- diff --git a/lib/DBIx/Class/Fixtures.pm b/lib/DBIx/Class/Fixtures.pm index 63c758e..495c841 100644 --- a/lib/DBIx/Class/Fixtures.pm +++ b/lib/DBIx/Class/Fixtures.pm @@ -29,6 +29,8 @@ our $VERSION = '1.000'; =head1 NAME +DBIx::Class::Fixtures + =head1 SYNOPSIS use DBIx::Class::Fixtures; @@ -124,7 +126,7 @@ sub dump { my $schema = $params->{schema}; - $self->msg("generating fixtures\n"); + $self->msg("generating fixtures"); my $tmp_output_dir = dir($output_dir, '-~dump~-'); unless (-e $tmp_output_dir) { diff --git a/lib/DBIx/Class/Fixtures/Versioned.pm b/lib/DBIx/Class/Fixtures/Versioned.pm index 0142814..3533688 100644 --- a/lib/DBIx/Class/Fixtures/Versioned.pm +++ b/lib/DBIx/Class/Fixtures/Versioned.pm @@ -16,17 +16,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,7 +30,7 @@ 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,14 +40,14 @@ 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(@_); + $schema->schema_version($params->{version}); # set the db version to the schema version - $schema->upgrade(); # set version number + $schema->upgrade(); # set version number return $schema; }