From: Jess Robinson Date: Thu, 3 Jan 2008 20:44:14 +0000 (+0000) Subject: Apply patch from billisdog to ensure we rebless to the correct class before fetching... X-Git-Tag: v0.08240~533^2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6088eb64a041952e9d75f6e634207650ddc456cc;p=dbsrgits%2FDBIx-Class.git Apply patch from billisdog to ensure we rebless to the correct class before fetching sequence data --- diff --git a/lib/DBIx/Class/Storage/DBI.pm b/lib/DBIx/Class/Storage/DBI.pm index 0676d38..5a3aedf 100644 --- a/lib/DBIx/Class/Storage/DBI.pm +++ b/lib/DBIx/Class/Storage/DBI.pm @@ -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) ); } }