summaryrefslogtreecommitdiff
path: root/app/controllers/projects/commit_controller.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-01-30 18:26:40 -0600
committerDouwe Maan <douwe@selenight.nl>2017-02-06 16:12:24 -0600
commitc8b63a28afa811881b617546fe94a19378585a04 (patch)
tree2b1bd2e9d52e059de0589a014f518f23e9b71ca3 /app/controllers/projects/commit_controller.rb
parent3aa1264dc6c0de3625bb1a2d6a0ee90140a2f519 (diff)
downloadgitlab-ce-c8b63a28afa811881b617546fe94a19378585a04.tar.gz
Improve performance of finding last deployed environment
Diffstat (limited to 'app/controllers/projects/commit_controller.rb')
-rw-r--r--app/controllers/projects/commit_controller.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/controllers/projects/commit_controller.rb b/app/controllers/projects/commit_controller.rb
index 08817afa1e9..5bcc545462f 100644
--- a/app/controllers/projects/commit_controller.rb
+++ b/app/controllers/projects/commit_controller.rb
@@ -96,7 +96,7 @@ class Projects::CommitController < Projects::ApplicationController
@diffs = commit.diffs(opts)
@notes_count = commit.notes.count
- @environment = @project.latest_environment_for(@commit)
+ @environment = @project.environments_for(commit: @commit).last
@environment = nil unless can?(current_user, :read_environment, @environment)
end