Commit 907548a0 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

dont render discussion diff unless note is for diff

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent f91f230c
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment