mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-09 12:46:07 +10:00
dont render discussion diff unless note is for diff
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
@@ -86,6 +86,8 @@ class Projects::NotesController < Projects::ApplicationController
|
||||
end
|
||||
|
||||
def note_to_discussion_with_diff_html(note)
|
||||
return unless note.for_diff_line?
|
||||
|
||||
render_to_string(
|
||||
"projects/notes/_discussion",
|
||||
layout: false,
|
||||
|
||||
@@ -183,6 +183,8 @@ class Note < ActiveRecord::Base
|
||||
# If exists - its active discussion
|
||||
# If not - its outdated diff
|
||||
def active?
|
||||
return true unless self.diff
|
||||
|
||||
noteable.diffs.each do |mr_diff|
|
||||
next unless mr_diff.new_path == self.diff.new_path
|
||||
|
||||
|
||||
Reference in New Issue
Block a user