[Bast-commits] r4449 -
branches/DBIx-Class-Schema-Loader/current/lib/DBIx/Class/Schema/Loader
ilmari at dev.catalyst.perl.org
ilmari at dev.catalyst.perl.org
Sun Jun 1 01:29:08 BST 2008
Author: ilmari
Date: 2008-06-01 01:29:08 +0100 (Sun, 01 Jun 2008)
New Revision: 4449
Modified:
branches/DBIx-Class-Schema-Loader/current/lib/DBIx/Class/Schema/Loader/Base.pm
Log:
Neuter Class::C3::reinitialize() around the schema reloading.
We're not changing any inheritance here, and this is equivalent to what
the old code did around _make_src_class().
Modified: branches/DBIx-Class-Schema-Loader/current/lib/DBIx/Class/Schema/Loader/Base.pm
===================================================================
--- branches/DBIx-Class-Schema-Loader/current/lib/DBIx/Class/Schema/Loader/Base.pm 2008-05-31 20:14:05 UTC (rev 4448)
+++ branches/DBIx-Class-Schema-Loader/current/lib/DBIx/Class/Schema/Loader/Base.pm 2008-06-01 00:29:08 UTC (rev 4449)
@@ -412,13 +412,19 @@
for my $table (@tables) {
my $moniker = $self->monikers->{$table};
my $class = $self->classes->{$table};
+
+ {
+ no warnings 'redefine';
+ local *Class::C3::reinitialize = sub {};
+ use warnings;
- if ( Class::Unload->unload( $class ) ) {
- my $resultset_class = ref $self->schema->resultset($moniker);
- Class::Unload->unload( $resultset_class )
- if $resultset_class ne 'DBIx::Class::ResultSet';
+ if ( Class::Unload->unload( $class ) ) {
+ my $resultset_class = ref $self->schema->resultset($moniker);
+ Class::Unload->unload( $resultset_class )
+ if $resultset_class ne 'DBIx::Class::ResultSet';
+ }
+ $class->require or die "Can't load $class: $@";
}
- $class->require or die "Can't load $class: $@";
$self->schema_class->register_class($moniker, $class);
$self->schema->register_class($moniker, $class)
More information about the Bast-commits
mailing list