_rebless for odbc
Rafael Kitover [Wed, 27 May 2009 04:40:39 +0000 (04:40 +0000)]
lib/DBIx/Class/Schema/Loader/DBI/ODBC.pm

index f709b5d..3cea159 100644 (file)
@@ -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;
+    }
   }
 }