Don't reload ActiveRecord objects when building note URLs
What does this MR do?
Avoid reloading AR objects when building note URLs, which we do for every note that wasn't authored by you (to show the report abuse button).
Are there points in the code the reviewer needs to double check?
Don't think so.
Why was this MR needed?
This isn't N+1 in SQL, because of the query cache, but there's still a lot of time spent building AR objects.
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary - Tests
-
All builds are passing
-
-
Conform by the merge request performance guides -
Conform by the style guides -
Branch has no merge conflicts with master
(if it does - rebase it please) -
Squashed related commits together
What are the relevant issue numbers?
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/34882.