Speedup DiffNote#active? on discussions
What does this MR do?
Use same noteable instance for difference discussions (using AR preloader), cache active? call for each discussion because is executed in more than one place on the UI. Avoid accessing git repository to get diff_refs for MR that already has that data stored in the database.
Are there points in the code the reviewer needs to double check?
Why was this MR needed?
Improve performance when loading MR with a lot of notes (DiffNotes)
What are the relevant issue numbers?
Relates with #14202 (moved) but more work to do (https://gitlab.com/gitlab-org/gitlab-ce/issues/14202#note_13491542).
Screenshots (if relevant)
Does this MR meet the acceptance criteria?
-
CHANGELOG entry added [ ] Documentation created/updated[ ] API support added- Tests
-
Added for this feature/bug -
All builds are passing
-
-
Conform by the style guides -
Branch has no merge conflicts with master
(if you do - rebase it please) -
Squashed related commits together