app/models/note.rb
# Check if this note is part of an "active" discussion
#
# This will always return true for anything except MergeRequest noteables,
# which have special logic.
#
# If the note's current diff cannot be matched in the MergeRequest's current
# diff, it's considered inactive.
Check if this note is part of an "active" discussion
This will always return true for anything except MergeRequest noteables,
which have special logic.

If the note's current diff cannot be matched in the MergeRequest's current
diff, it's considered inactive.
Check if this note is part of an " active " discussion This will always return true for anything except MergeRequest noteables which have special logic . If the note ' s current diff cannot be matched in the MergeRequest ' s current diff it ' s considered inactive .
def active?
    return true unless self.diff
    return false unless noteable
    return @active if defined?(@active)
    noteable_diff = find_noteable_diff
    if noteable_diff
      parsed_lines = Gitlab::Diff::Parser.new.parse(noteable_diff.diff.each_line)
      @active = parsed_lines.any? { |line_obj| line_obj.text == diff_line }
    else
      @active = false
    end
    @active
  end
def active? return true unless self . diff return false unless noteable return @active if defined? ( @active ) noteable_diff = find_noteable_diff if noteable_diff parsed_lines = Gitlab :: Diff :: Parser . new . parse ( noteable_diff . diff . each_line ) @active = parsed_lines . any? { | line_obj | line_obj . text == diff_line } else @active = false end @active end
Check if this note is part of an "active" discussion
This will always return true for anything except MergeRequest noteables,
which have special logic.
Check if this note is part of an " active " discussion This will always return true for anything except MergeRequest noteables which have special logic .