diff options
author | Stan Hu <stanhu@gmail.com> | 2016-06-28 15:14:11 -0700 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2016-06-29 06:26:00 -0700 |
commit | 8c29b0b06554eb9549fe9bd2f33e80ce149752fd (patch) | |
tree | 9c0f24bc41ada0eba858dc21cb50ed0d300dd202 /app/views | |
parent | a4b1fe4de951cb18a061b2be7b85988e6db26f5b (diff) | |
download | gitlab-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.haml | 2 |
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 |