Mark pending todos as done when resolving design discussions
What does this MR do?
Mark user pending todos as done when resolving design discussions.
Database
A new scope is introduced to filter todos by notes, it has index support.
Query generated:
SELECT "todos"."id"
FROM "todos"
WHERE "todos"."user_id" = 426128
AND ( "todos"."state" IN ( 'pending' ) )
AND "todos"."project_id" = 278964
AND "todos"."note_id" IN (532501224, 531766143, 532313540, 532546665, 535827257, 598069325, 598150644)
AND "todos"."state" != 'done' /* This filter seems redundant to me, we could try to remove it in a follow-up */
Query above was generated using notes from a discussion on gitlab
project: #323779 (comment 531766143)
https://explain.depesz.com/s/Fb62
Considerations
Maybe could implement this same functionality for merge requests in a follow-up?
related to #227691 (closed)
Edited by Felipe Artur