uc3-dmp-id 0.0.65 → 0.0.67
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/uc3-dmp-id/helper.rb +2 -3
- data/lib/uc3-dmp-id/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d4d8cadb560081925dec360c3e5915a3c211f75ca821ce6df00333e5848f30e1
|
4
|
+
data.tar.gz: 2338fed516beee598ca8d8e98cd71d22c5d521c1fa9eed3d6e97557d4a6c74b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab2b07a1dae559c3dc8600a8441db376ae6d9badbe6971588a136e60058b7933dee052f71c592d630079703474ece421972530ba69ce2ff92ec85a130ea31639
|
7
|
+
data.tar.gz: 7189facf0e52c45617b4c4e2231ffad72e596f088f0694fd7197529351608e6fd7e656000c53641465b2c5c543e461d963674752bc719311c320b108c57b1764
|
data/lib/uc3-dmp-id/helper.rb
CHANGED
@@ -140,8 +140,7 @@ module Uc3DmpId
|
|
140
140
|
dmp = json['dmp'].nil? ? json : json['dmp']
|
141
141
|
owner_org = dmp.fetch('contact', {}).fetch('contact_id', {})['identifier']
|
142
142
|
|
143
|
-
|
144
|
-
orgs.first
|
143
|
+
dmp.fetch('contributor', []).map { |contributor| contributor.fetch('contact_id', {})['identifier'] }.first
|
145
144
|
end
|
146
145
|
|
147
146
|
# Extract the Contact's affiliaiton ROR ID
|
@@ -152,7 +151,7 @@ module Uc3DmpId
|
|
152
151
|
owner_org = dmp.fetch('contact', {}).fetch('dmproadmap_affiliation', {}).fetch('affiliation_id', {})['identifier']
|
153
152
|
return owner_org unless owner_org.nil?
|
154
153
|
|
155
|
-
orgs = dmp.fetch('contributor').map do |contributor|
|
154
|
+
orgs = dmp.fetch('contributor', []).map do |contributor|
|
156
155
|
contributor.fetch('dmproadmap_affiliation', {}).fetch('affiliation_id', {})['identifier']
|
157
156
|
end
|
158
157
|
orgs.compact.max_by { |i| orgs.count(i) }
|
data/lib/uc3-dmp-id/version.rb
CHANGED