uc3-dmp-id 0.0.65 → 0.0.66
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: b2d9a4bba715adc0eb2b0101d9484d8a57ea7f3643a3cd63088191fa82da5157
|
4
|
+
data.tar.gz: b42b00fa9a0bfae9c4f69539ebb612f9c2ab063fe20b1d96987a62cbe35cae60
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aba3791e3f85c77c3b1fce370e8d4c62e441148c2ea399074ad794505165fb9475488b552001f29613eaf5540e300a3271fe66b83af55bb6410679526828906b
|
7
|
+
data.tar.gz: e5d2470504ff9dbc2d9c61552c69a20229de6ae29d32361df1cf197b4ca97252bfb2d353c3126f42ab2a9b5f601e18a39ef1d6b4ccb6949caa1b2cfdeb7dcdb5
|
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 do { |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