From 3ab33230f60e33e8d09c3b46f4cedbb57fa6656f Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Mon, 15 Jul 2019 00:23:43 +0200 Subject: [PATCH] handle affiliation versions --- app/serializers/doi_serializer.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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