X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FCDBICompat%2FLazyLoading.pm;fp=lib%2FDBIx%2FClass%2FCDBICompat%2FLazyLoading.pm;h=b3d18e913a4314ae4df17ef295396963f0e6d40f;hb=c0fcc63f9a95819d353c5640ad2cc8d2b956ad63;hp=add9390af0d0a5ce66d55f14bc1c7b7c536be87e;hpb=1c779eb2212fac3c44e615418c2b516e18cbc5e2;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/CDBICompat/LazyLoading.pm b/lib/DBIx/Class/CDBICompat/LazyLoading.pm index add9390..b3d18e9 100644 --- a/lib/DBIx/Class/CDBICompat/LazyLoading.pm +++ b/lib/DBIx/Class/CDBICompat/LazyLoading.pm @@ -11,6 +11,22 @@ sub resultset_instance { return $rs; } + +# Emulate that CDBI throws out all changed columns and reloads them on +# request in case the database modifies the new value (say, via a trigger) +sub update { + my $self = shift; + + my @dirty_columns = keys %{$self->{_dirty_columns}}; + + my $ret = $self->next::method(@_); + + delete $self->{_column_data}{$_} for @dirty_columns; + + return $ret; +} + + sub get_column { my ($self, $col) = @_; if ((ref $self) && (!exists $self->{'_column_data'}{$col})