diff --git a/app/serializers/doi_serializer.rb b/app/serializers/doi_serializer.rb index 15211020a..2346cd068 100644 --- a/app/serializers/doi_serializer.rb +++ b/app/serializers/doi_serializer.rb @@ -24,7 +24,7 @@ class DoiSerializer # for now override format for affiliations in production if Rails.env.production? Array.wrap(object.creators).map do |c| - c["affiliation"] = c.dig("affiliation", "name") if c.has_key?("affiliation") + c["affiliation"] = c.dig("affiliation", "name") if c["affiliation"].is_a?(Hash) c end else