From: Guillermo Roditi Date: Wed, 4 Feb 2009 22:19:45 +0000 (+0000) Subject: use store_column instead of set_column on insert X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=645de9002cae758b595dccef238f15f2414ad7c0;p=dbsrgits%2FDBIx-Class-Historic.git use store_column instead of set_column on insert --- diff --git a/Changes b/Changes index 4cc1824..8937b27 100644 --- a/Changes +++ b/Changes @@ -14,6 +14,8 @@ Revision history for DBIx::Class - new order_by => { -desc => 'colname' } syntax supported with SQLA >= 1.50 - PG array datatype supported with SQLA >= 1.50 + - insert should use store_column, not set_column to avoid marking + clean just-stored values as dirty. New test for this (groditi) 0.08099_05 2008-10-30 21:30:00 (UTC) - Rewritte of Storage::DBI::connect_info(), extended with an diff --git a/lib/DBIx/Class/Row.pm b/lib/DBIx/Class/Row.pm index 134e841..ba05001 100644 --- a/lib/DBIx/Class/Row.pm +++ b/lib/DBIx/Class/Row.pm @@ -263,7 +263,9 @@ sub insert { } my $updated_cols = $source->storage->insert($source, { $self->get_columns }); - $self->set_columns($updated_cols); + foreach my $col (keys %$updated_cols) { + $self->store_column($col, $updated_cols->{$col}); + } ## PK::Auto my @auto_pri = grep {