X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FPK.pm;h=5be483325f8de54751f396d555394a511075da3d;hb=d4daee7b54e38e4b3d3d0a77759bddc1a4ede6e5;hp=f282924ca569d21cce25deee52059bf584c334d3;hpb=7e38d85069fbeeff050dc736b756b60c01f85fc6;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/PK.pm b/lib/DBIx/Class/PK.pm index f282924..5be4833 100644 --- a/lib/DBIx/Class/PK.pm +++ b/lib/DBIx/Class/PK.pm @@ -42,16 +42,16 @@ sub discard_changes { my ($self, $attrs) = @_; delete $self->{_dirty_columns}; return unless $self->in_storage; # Don't reload if we aren't real! - + if( my $current_storage = $self->get_from_storage($attrs)) { - + # Set $self to the current. %$self = %$current_storage; - + # Avoid a possible infinite loop with # sub DESTROY { $_[0]->discard_changes } bless $current_storage, 'Do::Not::Exist'; - + return $self; } else { $self->in_storage(0);