summaryrefslogtreecommitdiff
path: root/app/controllers/projects/compare_controller.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-02-06 18:06:46 -0600
committerDouwe Maan <douwe@selenight.nl>2017-02-06 18:06:46 -0600
commit9d7c5e75841eff48217487b3acda56cf265a2aef (patch)
treed90819e572eab930a8729ed767f6565620922e8a /app/controllers/projects/compare_controller.rb
parentb0279cc2239e0b24d59bc80085a9ba42fcf6226a (diff)
downloadgitlab-ce-9d7c5e75841eff48217487b3acda56cf265a2aef.tar.gz
Address feedback
Diffstat (limited to 'app/controllers/projects/compare_controller.rb')
-rw-r--r--app/controllers/projects/compare_controller.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/app/controllers/projects/compare_controller.rb b/app/controllers/projects/compare_controller.rb
index d5cca827e9f..c6651254d70 100644
--- a/app/controllers/projects/compare_controller.rb
+++ b/app/controllers/projects/compare_controller.rb
@@ -57,9 +57,8 @@ class Projects::CompareController < Projects::ApplicationController
@diffs = @compare.diffs(diff_options)
- environment_args = @repository.branch_exists?(@head_ref) ? { ref: @head_ref } : { commit: @commit }
- @environment = @project.environments_for(**environment_args).last
- @environment = nil unless can?(current_user, :read_environment, @environment)
+ environment_params = @repository.branch_exists?(@head_ref) ? { ref: @head_ref } : { commit: @commit }
+ @environment = EnvironmentsFinder.new(@project, current_user, environment_params).execute.last
@diff_notes_disabled = true
@grouped_diff_discussions = {}