Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-08-17 16:00:10 +0300
committerDouwe Maan <douwe@selenight.nl>2017-08-17 16:00:10 +0300
commit3ef93db5a8dfb62f877731237a53fbdb8bc6e5f8 (patch)
tree8658f074fea021bc8690b72a9676df2e1081c8ff /app/serializers
parent834f1b30d50dc3ad9d0f6ff81cef24dc6ebc375c (diff)
Return null attachment when there is none
Diffstat (limited to 'app/serializers')
-rw-r--r--app/serializers/note_entity.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/serializers/note_entity.rb b/app/serializers/note_entity.rb
index e5295f5f34d..416730470dc 100644
--- a/app/serializers/note_entity.rb
+++ b/app/serializers/note_entity.rb
@@ -53,7 +53,7 @@ class NoteEntity < API::Entities::Note
end
end
- expose :attachment, using: NoteAttachmentEntity
+ expose :attachment, using: NoteAttachmentEntity, if: -> (note, _) { note.attachment? }
expose :delete_attachment_path, if: -> (note, _) { note.attachment? } do |note|
delete_attachment_project_note_path(note.project, note)
end