dor-services 5.22.1 → 5.22.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c6dab8f7f2a56e8bfde680d4785508bad8ce7142
4
- data.tar.gz: 565fe3f2bab1843247d24565b6a5e4109cc33f5d
3
+ metadata.gz: de7497db757f5546559abd987007ee78487e13f9
4
+ data.tar.gz: 56d444f210ebbe03556525bcc64ce69bc0cf083a
5
5
  SHA512:
6
- metadata.gz: 59ad5521ef58aa0ceaa66e5a75f55273f45041aec06f48587b2218bc4b9d2680fbb5e62844c11271025ba84d12f922515049c999eef2a11dc667a13593c956c4
7
- data.tar.gz: 31198cf58c69a2c3ff6dd434ef5ba04485b28df11f82f317ddbf9470fa8b8399671e8143bb6aac64e0b661ab04b6daf657502b2872856c1817db6d48a71f5f54
6
+ metadata.gz: 61bff550675570ac7ff5e8e0943b23640ee83d410d0fc5f871f2b559de9223924d4a526e966545d5c9a892c8495a0f7f5008b31a16f992833cb9cc55be48ab8d
7
+ data.tar.gz: 3e3d14df2b71a29ec2ebee2aaad532029308c93bf333bc02862e42984c58dca9aaedbcb6a2b0158643910185674a16890c6546b45c2967696b6f9947b1a57e48
@@ -102,17 +102,18 @@ module Dor
102
102
  # @return [String] same value, as per Ruby assignment convention
103
103
  def catkey=(val)
104
104
 
105
- # try and grab the current and previous catkeys
106
- current_catkey = catkey
105
+ if val != catkey && !catkey.blank? # if there was already a catkey in the record, store that in the "previous" spot (assuming there is no change)
106
+ identityMetadata.add_otherId("#{PREVIOUS_CATKEY_TYPE_ID}:#{catkey}")
107
+ end
107
108
 
108
- # if there is no current catkey, then add it and we are done
109
- if current_catkey.blank?
109
+ if val.blank? # if we are setting the catkey to blank, remove the node from XML
110
+ remove_other_Id(CATKEY_TYPE_ID)
111
+ elsif catkey.blank? # if there is no current catkey, then add it
110
112
  add_other_Id(CATKEY_TYPE_ID,val)
111
- elsif val != current_catkey # if there is a current catkey, store that in the "previous" spot assuming there is no change
112
- identityMetadata.add_otherId("#{PREVIOUS_CATKEY_TYPE_ID}:#{current_catkey}")
113
- # and then update the current catkey to the new value
113
+ elsif # if there is a current catkey, update the current catkey to the new value
114
114
  update_other_Id(CATKEY_TYPE_ID,val)
115
115
  end
116
+
116
117
  val
117
118
  end
118
119
 
data/lib/dor/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Dor
2
- VERSION = '5.22.1'.freeze
2
+ VERSION = '5.22.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dor-services
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.22.1
4
+ version: 5.22.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Klein
@@ -14,7 +14,7 @@ authors:
14
14
  autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
- date: 2017-02-28 00:00:00.000000000 Z
17
+ date: 2017-03-01 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: active-fedora