From: Rafael Kitover Date: Wed, 27 May 2009 04:40:39 +0000 (+0000) Subject: _rebless for odbc X-Git-Tag: 0.04999_08~11^2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b5e1caf241f3d490138366d044895ee977385739;p=dbsrgits%2FDBIx-Class-Schema-Loader.git _rebless for odbc --- diff --git a/lib/DBIx/Class/Schema/Loader/DBI/ODBC.pm b/lib/DBIx/Class/Schema/Loader/DBI/ODBC.pm index f709b5d..3cea159 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/ODBC.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/ODBC.pm @@ -35,7 +35,10 @@ sub _rebless { # Translate the backend name into a perl identifier $dbtype =~ s/\W/_/gi; my $class = "DBIx::Class::Schema::Loader::DBI::ODBC::${dbtype}"; - bless $self, $class if $self->load_optional_class($class); + if ($self->load_optional_class($class) && !$self->isa($class)) { + bless $self, $class; + $self->_rebless; + } } }