uc3-dmp-id 0.0.98 → 0.0.100

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: 6e67c682d15718449d9e74b2a63d99a25d702b26530728073df044ab40b8a743
4
- data.tar.gz: 6e8f4859645c076262d68dd351eb9c27b978932b238734ecfa02c608b5161966
3
+ metadata.gz: 980cf55dcebe87df7656894c5322def896fc16863fc8e1bb4d5a2c3f44c289df
4
+ data.tar.gz: 94dd8f43a9dc1108fe030f6651ea858f3445d6f27a42ba7f448fe4c311b180cd
5
5
  SHA512:
6
- metadata.gz: dc9e07e81387893b912a62d1e68a28aa35cbc6f25e8d571cd2c05b78780454b40f72cf779e57b2f6b8908ad6df25c81de2fe01f447fd1ca6945801984959f2a4
7
- data.tar.gz: 5dc220e48c1c46e719e7f6345a2f3712248a0ccbc1591e7eb5dcf09908ab49c78b4bec9b8de5f2807947cdbb02db8272aec4d5aae4bb7420b144d5accb2f51f6
6
+ metadata.gz: 1c54010fb9da4a20dd0604f7a88105aa79cb7129f8167abee1fd61d8bd1ea5a0186e721eab95cc46d71b227bd7faf8f98174bc91813f5cfac5a052cdb7956f75
7
+ data.tar.gz: 7033cdaf7cddb6dcfe307fd33117e472fe69068d23b34b545cca023452382da953c73ed7f4c525e3ff7e07400d3df0eaeeafb3db3742f98a2941877d6ca80df6
@@ -30,8 +30,13 @@ module Uc3DmpId
30
30
  # Splice together assertions made while the user was updating the DMP ID
31
31
  def splice(latest_version:, modified_version:, logger: nil)
32
32
  # Return the modified_version if the timestamps are the same (meaning no new assertions were made while the
33
- # user was working on the DMP ID)
34
- return modified_version if latest_version['dmphub_updated_at'] == modified_version['dmphub_updated_at']
33
+ # user was working on the DMP ID) OR neither version has assertions
34
+ return modified_version if latest_version['dmphub_updated_at'] == modified_version['dmphub_updated_at'] ||
35
+ (latest_version.fetch('dmphub_assertions', []).empty? &&
36
+ modified_version.fetch('dmphub_assertions', []).empty?)
37
+
38
+ puts "LATEST_VERSION ASSERTIONS: #{latest_version['dmphub_assertions']}"
39
+ puts "MODIFIED_VERSION ASSERTIONS: #{modified_version['dmphub_assertions']}"
35
40
 
36
41
  # Clone any existing assertions on the current DMP ID so we can manipulate them
37
42
  existing_assertions = Helper.deep_copy_dmp(obj: latest_version.fetch('dmphub_assertions', []))
@@ -29,7 +29,7 @@ module Uc3DmpId
29
29
  logger.error(message: errs.join(', ')) if errs.is_a?(Array) && errs.any?
30
30
  raise UpdaterError, errs if errs.is_a?(Array) && errs.any?
31
31
  # Don't continue if nothing has changed!
32
- raise UpdaterError, MSG_NO_CHANGE if Helper.eql?(dmp_a: latest, dmp_b: mods)
32
+ raise UpdaterError, MSG_NO_CHANGE if Helper.eql?(dmp_a: latest_version, dmp_b: mods)
33
33
 
34
34
  # Version the DMP ID record (if applicable).
35
35
  owner = latest_version['dmphub_provenance_id']
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Uc3DmpId
4
- VERSION = '0.0.98'
4
+ VERSION = '0.0.100'
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.98
4
+ version: 0.0.100
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Riley