diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-02-06 18:06:46 -0600 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-02-06 18:06:46 -0600 |
commit | 9d7c5e75841eff48217487b3acda56cf265a2aef (patch) | |
tree | d90819e572eab930a8729ed767f6565620922e8a /app/controllers/projects/compare_controller.rb | |
parent | b0279cc2239e0b24d59bc80085a9ba42fcf6226a (diff) | |
download | gitlab-ce-9d7c5e75841eff48217487b3acda56cf265a2aef.tar.gz |
Address feedback
Diffstat (limited to 'app/controllers/projects/compare_controller.rb')
-rw-r--r-- | app/controllers/projects/compare_controller.rb | 5 |
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 = {} |