diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-06-24 13:49:34 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-06-24 13:49:34 +0300 |
commit | a5f23435f7d8b8040ed6b80322ccea3fa8323468 (patch) | |
tree | b42573e97f626add0f7d8e108b82a89de2ea3364 /app/views/projects/issues/_discussion.html.haml | |
parent | c83bbfa79e6cfaefc21b0eaaa93370d8748e9aab (diff) |
Improve performance for issue#show page
* store @participants in variable
* store result of subscribed? call into variable
In total it reduce amount of SQL queries for issue with 10 comments/participants twice.
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/views/projects/issues/_discussion.html.haml')
-rw-r--r-- | app/views/projects/issues/_discussion.html.haml | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/views/projects/issues/_discussion.html.haml b/app/views/projects/issues/_discussion.html.haml index 48858fa32da..656e06ca105 100644 --- a/app/views/projects/issues/_discussion.html.haml +++ b/app/views/projects/issues/_discussion.html.haml @@ -12,8 +12,8 @@ .votes-holder.pull-right #votes= render 'votes/votes_block', votable: @issue .participants - %span= pluralize(@issue.participants(current_user).count, 'participant') - - @issue.participants(current_user).each do |participant| + %span= pluralize(@participants.count, 'participant') + - @participants.each do |participant| = link_to_member(@project, participant, name: false, size: 24) .voting_notes#notes= render 'projects/notes/notes_with_form' %aside.col-md-3 |