From: David Kamholz Date: Sun, 18 Jun 2006 23:00:00 +0000 (+0000) Subject: fix the fix of the fix of the fix X-Git-Tag: v0.07002~75^2~106^2~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9f4710678c1d9c959cc13574e7aa0881d3adbf49;p=dbsrgits%2FDBIx-Class.git fix the fix of the fix of the fix --- diff --git a/lib/DBIx/Class/InflateColumn.pm b/lib/DBIx/Class/InflateColumn.pm index 165b632..382b332 100644 --- a/lib/DBIx/Class/InflateColumn.pm +++ b/lib/DBIx/Class/InflateColumn.pm @@ -126,8 +126,13 @@ analogous to L. sub set_inflated_column { my ($self, $col, $obj) = @_; - delete $self->{_inflated_column}{$col}; - return $self->set_column($col, $self->_deflated_column($col, $obj)); + $self->set_column($col, $self->_deflated_column($col, $obj)); + if (blessed $obj) { + $self->{_inflated_column}{$col} = $obj; + } else { + delete $self->{_inflated_column}{$col}; + } + return $obj; } =head2 store_inflated_column @@ -141,6 +146,10 @@ as dirty. This is directly analogous to L. sub store_inflated_column { my ($self, $col, $obj) = @_; + unless (blessed $obj) { + delete $self->{_inflated_column}{$col}; + return undef; + } delete $self->{_column_data}{$col}; return $self->{_inflated_column}{$col} = $obj; }