[Bast-commits] r8714 - in DBIx-Class/0.08/trunk:
lib/DBIx/Class/Storage t
rafl at dev.catalyst.perl.org
rafl at dev.catalyst.perl.org
Mon Feb 15 14:50:01 GMT 2010
Author: rafl
Date: 2010-02-15 14:50:01 +0000 (Mon, 15 Feb 2010)
New Revision: 8714
Modified:
DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI.pm
DBIx-Class/0.08/trunk/t/86sqlt.t
Log:
Make sure overriding deployment_statements is possible from within schemas.
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI.pm 2010-02-15 14:49:55 UTC (rev 8713)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI.pm 2010-02-15 14:50:01 UTC (rev 8714)
@@ -2442,7 +2442,7 @@
}
$self->_query_end($line);
};
- my @statements = $self->deployment_statements($schema, $type, undef, $dir, { %{ $sqltargs || {} }, no_comments => 1 } );
+ my @statements = $schema->deployment_statements($type, undef, $dir, { %{ $sqltargs || {} }, no_comments => 1 } );
if (@statements > 1) {
foreach my $statement (@statements) {
$deploy->( $statement );
Modified: DBIx-Class/0.08/trunk/t/86sqlt.t
===================================================================
--- DBIx-Class/0.08/trunk/t/86sqlt.t 2010-02-15 14:49:55 UTC (rev 8713)
+++ DBIx-Class/0.08/trunk/t/86sqlt.t 2010-02-15 14:50:01 UTC (rev 8714)
@@ -12,6 +12,14 @@
unless DBIx::Class::Optional::Dependencies->req_ok_for ('deploy')
}
+my $custom_deployment_statements_called = 0;
+
+sub DBICTest::Schema::deployment_statements {
+ $custom_deployment_statements_called = 1;
+ my $self = shift;
+ return $self->next::method(@_);
+}
+
my $schema = DBICTest->init_schema (no_deploy => 1);
@@ -69,6 +77,7 @@
$schema->deploy; # do not remove, this fires the is() test in the callback above
ok($deploy_hook_called, 'deploy hook got called');
+ ok($custom_deployment_statements_called, '->deploy used the schemas deploy_statements method');
}
More information about the Bast-commits
mailing list