X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FRow.pm;h=02e51d3cde8bb23751266df18477dd09c6d3081c;hb=ad3f2296a99dac262f948f07f36a635d69995c8b;hp=ecbff0ca837be9cea8d8cbe483ecfad685a0d86c;hpb=5f7ac523d6179423620e5d20a83d3245a2f29385;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Row.pm b/lib/DBIx/Class/Row.pm index ecbff0c..02e51d3 100644 --- a/lib/DBIx/Class/Row.pm +++ b/lib/DBIx/Class/Row.pm @@ -519,17 +519,17 @@ this method. sub update { my ($self, $upd) = @_; - 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; - $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; + my $rows = $self->result_source->storage->update( $self->result_source, \%to_update, $ident_cond );