debian-mirror-gitlab/app/models/concerns/note_on_diff.rb
2017-08-17 22:00:37 +05:30

46 lines
723 B
Ruby

# Contains functionality shared between `DiffNote` and `LegacyDiffNote`.
module NoteOnDiff
extend ActiveSupport::Concern
def diff_note?
true
end
def diff_file
raise NotImplementedError
end
def diff_line
raise NotImplementedError
end
def for_line?(line)
raise NotImplementedError
end
def original_line_code
raise NotImplementedError
end
def diff_attributes
raise NotImplementedError
end
def active?(diff_refs = nil)
raise NotImplementedError
end
def created_at_diff?(diff_refs)
false
end
private
def noteable_diff_refs
if noteable.respond_to?(:diff_sha_refs)
noteable.diff_sha_refs
else
noteable.diff_refs
end
end
end