summaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2016-06-28 15:14:11 -0700
committerStan Hu <stanhu@gmail.com>2016-06-29 06:26:00 -0700
commit8c29b0b06554eb9549fe9bd2f33e80ce149752fd (patch)
tree9c0f24bc41ada0eba858dc21cb50ed0d300dd202 /app/views
parenta4b1fe4de951cb18a061b2be7b85988e6db26f5b (diff)
downloadgitlab-ce-8c29b0b06554eb9549fe9bd2f33e80ce149752fd.tar.gz
Memoize the maximum access level for the author of notes
In #19273, we saw that retrieving ProjectTeam#human_max_access for each note takes the bulk of the time when rendering certain issues or merge requests. We observe that most of the comments in an issue are typically done by the same users. This MR memoizes the max access level by user ID.
Diffstat (limited to 'app/views')
-rw-r--r--app/views/projects/notes/_note.html.haml2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/views/projects/notes/_note.html.haml b/app/views/projects/notes/_note.html.haml
index a5e163b91e9..af0046886fb 100644
--- a/app/views/projects/notes/_note.html.haml
+++ b/app/views/projects/notes/_note.html.haml
@@ -17,7 +17,7 @@
%a{ href: "##{dom_id(note)}" }
= time_ago_with_tooltip(note.created_at, placement: 'bottom', html_class: 'note-created-ago')
.note-actions
- - access = note.project.team.human_max_access(note.author.id)
+ - access = note_max_access_for_user(note)
- if access and not note.system
%span.note-role.hidden-xs= access
- if current_user and not note.system