Skip to content

Commit

Permalink
Merge pull request #875 from datacite/related_items_serializer_fix
Browse files Browse the repository at this point in the history
Serializer: Replace related_items with [] if it doesn't exist
  • Loading branch information
digitaldogsbody authored Nov 2, 2022
2 parents 169bdb9 + 02d51b9 commit 26f51fb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/serializers/datacite_doi_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,11 @@ class DataciteDoiSerializer
end

attribute :related_items do |object|
Array.wrap(object.related_items)
if object.related_items?
Array.wrap(object.related_items)
else
[]
end
end

attribute :geo_locations,
Expand Down

0 comments on commit 26f51fb

Please sign in to comment.