BigW Consortium Gitlab

Commit b9aa6c35 by Bob Van Landuyt Committed by Bob Van Landuyt

Optimize finding `discussions_to_resolve`

parent f0dd2a54
...@@ -25,11 +25,15 @@ module Issues ...@@ -25,11 +25,15 @@ module Issues
def discussions_to_resolve def discussions_to_resolve
return [] unless merge_request_for_resolving_discussions return [] unless merge_request_for_resolving_discussions
@discussions_to_resolve ||= NotesFinder.new(project, current_user, { @discussions_to_resolve ||= begin
discussion_id: discussion_to_resolve_id, if discussion_to_resolve_id
target_type: MergeRequest.name.underscore, Array(merge_request_for_resolving_discussions.
target_id: merge_request_for_resolving_discussions.id find_diff_discussion(discussion_to_resolve_id))
}).execute.discussions.select(&:to_be_resolved?) else
merge_request_for_resolving_discussions
.resolvable_discussions
end
end
end end
end end
end end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment