From: Matt S Trout Date: Sun, 27 Nov 2005 16:34:52 +0000 (+0000) Subject: Fixed InflateColumn to call set_column during set_inflated_column X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=47bd0267e91b5dbaea2cdbc9c28ec661c06849c8;p=dbsrgits%2FDBIx-Class-Historic.git Fixed InflateColumn to call set_column during set_inflated_column --- diff --git a/Changes b/Changes index fdc7452..108399f 100644 --- a/Changes +++ b/Changes @@ -1,9 +1,14 @@ Revision history for DBIx::Class +0.04001 + - Fix so set_inflated_column calls set_column + +0.04 2005-11-26 - Moved get_simple and set_simple into AccessorGroup - Made 'new' die if given invalid columns - Added has_column and column_info to Table.pm - Refactored away from direct use of _columns and _primaries + - Switched from NEXT to Class::C3 0.03004 - Added an || '' to the CDBICompat stringify to avoid null warnings diff --git a/lib/DBIx/Class.pm b/lib/DBIx/Class.pm index 8966c98..744cb4a 100644 --- a/lib/DBIx/Class.pm +++ b/lib/DBIx/Class.pm @@ -6,7 +6,7 @@ use warnings; use vars qw($VERSION); use base qw/DBIx::Class::Componentised Class::Data::Inheritable/; -$VERSION = '0.04'; +$VERSION = '0.04001'; 1; diff --git a/lib/DBIx/Class/InflateColumn.pm b/lib/DBIx/Class/InflateColumn.pm index c612832..25995ab 100644 --- a/lib/DBIx/Class/InflateColumn.pm +++ b/lib/DBIx/Class/InflateColumn.pm @@ -46,24 +46,29 @@ sub get_inflated_column { sub set_inflated_column { my ($self, $col, @rest) = @_; - my $ret = $self->store_inflated_column($col, @rest); - $self->{_dirty_columns}{$col} = 1; + my $ret = $self->_inflated_column_op('set', $col, @rest); return $ret; } sub store_inflated_column { - my ($self, $col, $obj) = @_; + my ($self, $col, @rest) = @_; + my $ret = $self->_inflated_column_op('store', $col, @rest); + return $ret; +} + +sub _inflated_column_op { + my ($self, $op, $col, $obj) = @_; + my $meth = "${op}_column"; unless (ref $obj) { delete $self->{_inflated_column}{$col}; - return $self->store_column($col, $obj); + return $self->$meth($col, $obj); } my $deflated = $self->_deflated_column($col, $obj); # Do this now so we don't store if it's invalid $self->{_inflated_column}{$col} = $obj; - #warn "Storing $obj: ".($obj->_ident_values)[0]; - $self->store_column($col, $deflated); + $self->$meth($col, $deflated); return $obj; }