uc3-dmp-id 0.0.69 → 0.0.71

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: add557c6bfad4f39ab0fcc4b164b4a50dd2f33c9fefa823ad95145e40d2d2495
4
- data.tar.gz: 8b1fb5ab9edbb3e783d95419eac15f645fab8c91804a24f24996dfabb74f130a
3
+ metadata.gz: 99921e6917f8a405ae38995e797bb69bf05499813ff9b07271ded5657285f94d
4
+ data.tar.gz: 17637fbbebb9632878be57ef1b1d53ca6e77cad7dc1505c68bf7626eb47734dd
5
5
  SHA512:
6
- metadata.gz: 937ecb14c0178243e8c91ec21af41343cc6f9b898104587fa856723a2b9b87d335819f9838f7838382dbc65661c753e6836f526e526954bdaa1c159621d1df1f
7
- data.tar.gz: 4d0adec75e6ad372d21a9a2d56565381e5cf898366f55474465c046801ae067c753eda2a4b00e2a69e70116016532d4ee9b3aaf16952a6d216ddb4de3a5e032b
6
+ metadata.gz: 9c0b78403c2fcd65a18fce747a91fe3222d1adb895a94f0f2dde1c7957eed7c024a0b3b0ca9170c57a594aded1a1fa56fab1ea43b9f470da7407768bfac0b0e6
7
+ data.tar.gz: a7f28875760efb596897e48a17bfe16abef184282fa279bf03e885dfee2bd159fd4bd3c92f95b282d964897189c4ee1b00af5d18ae1e328a2cdcc49cd713ec19
@@ -37,7 +37,7 @@ module Uc3DmpId
37
37
  # return by_provenance_identifier(json: json, client: client, debug: debug) if p_key.nil?
38
38
 
39
39
  # find_by_PK
40
- by_pk(p_key: p_key, s_key: json['SK'], client: client, debug: debug)
40
+ p_key.nil? ? nil : by_pk(p_key: p_key, s_key: json['SK'], client: client, debug: debug)
41
41
  end
42
42
 
43
43
  # Find the DMP by its PK and SK
@@ -191,9 +191,15 @@ module Uc3DmpId
191
191
  json.fetch('dmp_id', {})['identifier'].nil?
192
192
 
193
193
  # Record the original Provenance system's identifier
194
- annotated['dmphub_provenance_identifier'] = format_provenance_id(
195
- provenance: provenance, value: json.fetch('dmp_id', {})['identifier']
196
- )
194
+ # If we are currently seeding records for existing DMP IDs, then use the :dmproadmap_links
195
+ if provenance.fetch('seedingWithLiveDmpIds', false).to_s.downcase == 'true' &&
196
+ !annotated.fetch('dmproadmap_links', {})['get'].nil?
197
+ annotated['dmphub_provenance_identifier'] = annotated.fetch('dmproadmap_links', {})['get']
198
+ else
199
+ annotated['dmphub_provenance_identifier'] = format_provenance_id(
200
+ provenance: provenance, value: json.fetch('dmp_id', {})['identifier']
201
+ )
202
+ end
197
203
  annotated
198
204
  end
199
205
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Uc3DmpId
4
- VERSION = '0.0.69'
4
+ VERSION = '0.0.71'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uc3-dmp-id
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.69
4
+ version: 0.0.71
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Riley