Skip to content

Commit

Permalink
Replace related_items with [] if it doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
digitaldogsbody committed Nov 2, 2022
1 parent 169bdb9 commit 02d51b9
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 02d51b9

Please sign in to comment.