summaryrefslogtreecommitdiff
path: root/app/models/concerns/note_on_diff.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/concerns/note_on_diff.rb')
-rw-r--r--app/models/concerns/note_on_diff.rb17
1 files changed, 14 insertions, 3 deletions
diff --git a/app/models/concerns/note_on_diff.rb b/app/models/concerns/note_on_diff.rb
index b8dd27a7afe..6359f7596b1 100644
--- a/app/models/concerns/note_on_diff.rb
+++ b/app/models/concerns/note_on_diff.rb
@@ -1,3 +1,4 @@
+# Contains functionality shared between `DiffNote` and `LegacyDiffNote`.
module NoteOnDiff
extend ActiveSupport::Concern
@@ -25,11 +26,21 @@ module NoteOnDiff
raise NotImplementedError
end
- def can_be_award_emoji?
+ def active?(diff_refs = nil)
+ raise NotImplementedError
+ end
+
+ def created_at_diff?(diff_refs)
false
end
- def to_discussion
- Discussion.new([self])
+ private
+
+ def noteable_diff_refs
+ if noteable.respond_to?(:diff_sha_refs)
+ noteable.diff_sha_refs
+ else
+ noteable.diff_refs
+ end
end
end