diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-08-17 15:00:10 +0200 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-08-17 15:00:10 +0200 |
commit | 3ef93db5a8dfb62f877731237a53fbdb8bc6e5f8 (patch) | |
tree | 8658f074fea021bc8690b72a9676df2e1081c8ff /app/serializers | |
parent | 834f1b30d50dc3ad9d0f6ff81cef24dc6ebc375c (diff) | |
download | gitlab-ce-3ef93db5a8dfb62f877731237a53fbdb8bc6e5f8.tar.gz |
Return null attachment when there is none
Diffstat (limited to 'app/serializers')
-rw-r--r-- | app/serializers/note_entity.rb | 2 |
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 |