Skip to content

Commit

Permalink
dont delete done tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
oma-s committed Jan 17, 2024
1 parent c3df49e commit eeb5af3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit eeb5af3

Please sign in to comment.