summaryrefslogtreecommitdiff
path: root/lib/api
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2016-06-20 19:15:44 +0200
committerDouwe Maan <douwe@selenight.nl>2016-07-06 18:50:59 -0400
commita27462a5c6da0182f6b3a55c9417e6405f2c0415 (patch)
tree6bdf936568c0f9274cbf24db7f8b6517b2200980 /lib/api
parent375193455aa5cb752f1035a6cc69160170a58477 (diff)
downloadgitlab-ce-a27462a5c6da0182f6b3a55c9417e6405f2c0415.tar.gz
Extract parts of LegacyDiffNote into DiffOnNote concern and move part of responsibility to other classes
Diffstat (limited to 'lib/api')
-rw-r--r--lib/api/entities.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb
index 8cc4368b5c2..db877d2eeb0 100644
--- a/lib/api/entities.rb
+++ b/lib/api/entities.rb
@@ -240,9 +240,9 @@ module API
class CommitNote < Grape::Entity
expose :note
- expose(:path) { |note| note.diff_file_path if note.legacy_diff_note? }
- expose(:line) { |note| note.diff_new_line if note.legacy_diff_note? }
- expose(:line_type) { |note| note.diff_line_type if note.legacy_diff_note? }
+ expose(:path) { |note| note.diff_file.try(:file_path) if note.diff_note? }
+ expose(:line) { |note| note.diff_line.try(:new_line) if note.diff_note? }
+ expose(:line_type) { |note| note.diff_line.try(:type) if note.diff_note? }
expose :author, using: Entities::UserBasic
expose :created_at
end