From: Nigel Metheringham Date: Fri, 7 May 2010 13:48:19 +0000 (+0000) Subject: empty update OK even if row is not in database (fixed2) X-Git-Tag: v0.08122~76 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=dbsrgits%2FDBIx-Class.git;a=commitdiff_plain;h=97a509759922e70ec9094e249524cfd2a26af31e empty update OK even if row is not in database (fixed2) --- diff --git a/lib/DBIx/Class/Row.pm b/lib/DBIx/Class/Row.pm index 02e51d3..31c7028 100644 --- a/lib/DBIx/Class/Row.pm +++ b/lib/DBIx/Class/Row.pm @@ -519,14 +519,14 @@ this method. sub update { my ($self, $upd) = @_; + my $ident_cond = $self->{_orig_ident} || $self->ident_condition; + $self->set_inflated_columns($upd) if $upd; my %to_update = $self->get_dirty_columns; return $self unless keys %to_update; $self->throw_exception( "Not in database" ) unless $self->in_storage; - my $ident_cond = $self->{_orig_ident} || $self->ident_condition; - $self->throw_exception('Unable to update a row with incomplete or no identity') if ! keys %$ident_cond;