Statisfy Robertcop and Seancop

This commit is contained in:
Douwe Maan 2017-04-11 10:51:48 -05:00
parent 4f8c36c03c
commit 543dcdacc2
2 changed files with 4 additions and 10 deletions

View file

@ -135,15 +135,9 @@ class MergeRequestDiff < ActiveRecord::Base
end
def diff_refs=(new_diff_refs)
if new_diff_refs
self.base_commit_sha = new_diff_refs.base_sha
self.start_commit_sha = new_diff_refs.start_sha
self.head_commit_sha = new_diff_refs.head_sha
else
self.base_commit_sha = nil
self.start_commit_sha = nil
self.head_commit_sha = nil
end
self.base_commit_sha = new_diff_refs&.base_sha
self.start_commit_sha = new_diff_refs&.start_sha
self.head_commit_sha = new_diff_refs&.head_sha
end
def diff_refs

View file

@ -81,7 +81,7 @@
- if @start_sha
Comments are disabled because you're comparing two versions of this merge request.
- else
Discussions on this old version of the merge request are displayed but comment creation is disabled.
Discussions on this version of the merge request are displayed but comment creation is disabled.
.pull-right
= link_to 'Show latest version', diffs_namespace_project_merge_request_path(@project.namespace, @project, @merge_request), class: 'btn btn-sm'