From eeb5af32d30bb20c3bf7ccf70eb8d0140abc4f72 Mon Sep 17 00:00:00 2001 From: Malte S Date: Wed, 17 Jan 2024 10:51:00 +0100 Subject: [PATCH] dont delete done tasks --- app/models/task.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/task.rb b/app/models/task.rb index 6a10c556..952c6fcf 100644 --- a/app/models/task.rb +++ b/app/models/task.rb @@ -45,7 +45,7 @@ def sync_with_github end Task.transaction do - Task.where(github_id: deleted_ids).destroy_all if deleted_ids.any? + Task.where(github_id: deleted_ids).where.not(status: "done").destroy_all if deleted_ids.any? if tasks.any? task_ids_by_github_id = Task.upsert_all(tasks, returning: [:github_id, :id], unique_by: [:github_id]).rows.to_h