SL::DB::BackgroundJob: refactoring von set_data für mehr programmatische Sicherheit
[kivitendo-erp.git] / SL / DB / BackgroundJob.pm
index 10e319b..2040297 100644 (file)
@@ -84,9 +84,10 @@ sub data_as_hash {
 sub set_data {
   my ($self, %data) = @_;
 
-  my $data = YAML::Load($self->data);
-  $data->{$_} = $data{$_} for keys %data;
-  $self->data(YAML::Dump($data));
+  $self->data(YAML::Dump({
+    %{ $self->data_as_hash },
+    %data,
+  }));
 
   $self;
 }