diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-01-30 18:26:40 -0600 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-02-06 16:12:24 -0600 |
commit | c8b63a28afa811881b617546fe94a19378585a04 (patch) | |
tree | 2b1bd2e9d52e059de0589a014f518f23e9b71ca3 /app/controllers/projects/compare_controller.rb | |
parent | 3aa1264dc6c0de3625bb1a2d6a0ee90140a2f519 (diff) | |
download | gitlab-ce-c8b63a28afa811881b617546fe94a19378585a04.tar.gz |
Improve performance of finding last deployed environment
Diffstat (limited to 'app/controllers/projects/compare_controller.rb')
-rw-r--r-- | app/controllers/projects/compare_controller.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/controllers/projects/compare_controller.rb b/app/controllers/projects/compare_controller.rb index 6c94a79f842..142df1ba4e9 100644 --- a/app/controllers/projects/compare_controller.rb +++ b/app/controllers/projects/compare_controller.rb @@ -58,7 +58,7 @@ class Projects::CompareController < Projects::ApplicationController @diffs = @compare.diffs(diff_options) branch_name = @head_ref if @repository.branch_exists?(@head_ref) - @environment = @project.latest_environment_for(@commit, ref: branch_name) + @environment = @project.environments_for(commit: @commit, ref: branch_name).last @environment = nil unless can?(current_user, :read_environment, @environment) @diff_notes_disabled = true |