Apply patch from billisdog to ensure we rebless to the correct class before fetching...
Jess Robinson [Thu, 3 Jan 2008 20:44:14 +0000 (20:44 +0000)]
lib/DBIx/Class/Storage/DBI.pm

index 0676d38..5a3aedf 100644 (file)
@@ -1024,6 +1024,7 @@ sub insert {
       my $col_info = $source->column_info($col);
 
       if ( $col_info->{auto_nextval} ) {
+        $self->ensure_connected; 
         $to_insert->{$col} = $self->_sequence_fetch( 'nextval', $col_info->{sequence} || $self->_dbh_get_autoinc_seq($self->dbh, $source) );
       }
     }