Disable comments on older merge request diff

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
Dmitriy Zaporozhets 2016-08-22 18:21:28 +03:00
parent d7a9dcc1b1
commit 7b3fd81673
No known key found for this signature in database
GPG key ID: 627C5F589F467F17

View file

@ -93,6 +93,11 @@ class Projects::MergeRequestsController < Projects::ApplicationController
respond_to do |format|
format.html { define_discussion_vars }
format.json do
if @merge_request_diff != @merge_request.merge_request_diff
# Disable comments if browsing older version of the diff
@diff_notes_disabled = true
end
@diffs = @merge_request_diff.diffs(diff_options)
render json: { html: view_to_html_string("projects/merge_requests/show/_diffs") }