diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-06-24 12:56:10 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-06-24 12:56:10 +0200 |
commit | a3f64b195effa4ac5fca657df3e74696158416b1 (patch) | |
tree | 6a0e0dc1c49b8beff26d0967b17fe42b356c8788 /app/controllers/projects/merge_requests_controller.rb | |
parent | a5f23435f7d8b8040ed6b80322ccea3fa8323468 (diff) | |
download | gitlab-ce-a3f64b195effa4ac5fca657df3e74696158416b1.tar.gz |
Improve performance for merge_request#show page
* store @participants in variable
* store result of subscribed? call into variable
In total it reduce amount of SQL queries for merge_request with 10
comments/participants twice.
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/controllers/projects/merge_requests_controller.rb')
-rw-r--r-- | app/controllers/projects/merge_requests_controller.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/controllers/projects/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb index 51ecbfd561a..a13688305b7 100644 --- a/app/controllers/projects/merge_requests_controller.rb +++ b/app/controllers/projects/merge_requests_controller.rb @@ -246,6 +246,8 @@ class Projects::MergeRequestsController < Projects::ApplicationController end def define_show_vars + @participants = @merge_request.participants(current_user, @project) + # Build a note object for comment form @note = @project.notes.new(noteable: @merge_request) @notes = @merge_request.mr_and_commit_notes.inc_author.fresh |