From 4e18047a0c80ab7c6e6b95e6b6cb79cc0489a6cc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Tue, 18 May 2021 15:49:32 +0200 Subject: [PATCH] Zeiterfassung: als gebucht markieren: Manager-Methode update_all statt Schleife --- SL/Controller/TimeRecording.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/SL/Controller/TimeRecording.pm b/SL/Controller/TimeRecording.pm index 10870efd0..930f346d6 100644 --- a/SL/Controller/TimeRecording.pm +++ b/SL/Controller/TimeRecording.pm @@ -90,8 +90,10 @@ sub action_mark_as_booked { my ($self) = @_; if (scalar @{ $::form->{ids} }) { - my $trs = SL::DB::Manager::TimeRecording->get_all(query => [id => $::form->{ids}]); - $_->update_attributes(booked => 1) for @$trs; + SL::DB::Manager::TimeRecording->update_all( + set => { booked => 1 }, + where => [ id => $::form->{ids} ] + ); } $self->redirect_to(safe_callback()); -- 2.20.1