From: Rafael Kitover Date: Thu, 30 Jul 2009 14:26:47 +0000 (+0000) Subject: make sure the new mssql insert method works on an un-reblessed storage X-Git-Tag: v0.08109~47^2~15 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=21c06fdcf92f65c045cc83783e2d0d7764087442;hp=22d6d8e1a55e0bf7f9d64545afa97c582a6f754e;p=dbsrgits%2FDBIx-Class.git make sure the new mssql insert method works on an un-reblessed storage --- diff --git a/lib/DBIx/Class/Storage/DBI.pm b/lib/DBIx/Class/Storage/DBI.pm index 1d1e57b..b711230 100644 --- a/lib/DBIx/Class/Storage/DBI.pm +++ b/lib/DBIx/Class/Storage/DBI.pm @@ -1142,12 +1142,16 @@ sub _execute { sub insert { my ($self, $source, $to_insert) = @_; + if ((not $self->_dbh) && ref($self) eq __PACKAGE__) { + $self->_determine_driver; + goto $self->can('insert'); + } + my $ident = $source->from; my $bind_attributes = $self->source_bind_attributes($source); my $updated_cols = {}; - $self->ensure_connected; foreach my $col ( $source->columns ) { if ( !defined $to_insert->{$col} ) { my $col_info = $source->column_info($col);