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