dor-services 9.4.0 → 9.5.0

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: 496d07425ebd926eb69390d391aae0adfa646e365559152389b6ab75bd8c6f83
4
- data.tar.gz: d76539bcc0b0516998343292cde5679071cb4cab7e8e7b6c3838801ac8158dfa
3
+ metadata.gz: f696769ddd2ceb91345d4d0b7aa5b3ebdfa1b84a3c990055187f058b2d422a66
4
+ data.tar.gz: 0d354e436399a02330fdd07db2fae0b0eddfa14c710d93807aadb925dfa57c0f
5
5
  SHA512:
6
- metadata.gz: 70cc7de352cf5b9dfa40da2e54d29c016e3d04f30736a1775cb8c302d0cd77b6f7250d29f13a43ae536c1dabc2e9ae56ab38d1bba6091e92497b32decac965c8
7
- data.tar.gz: da9531081f100de69b0cf6af3e5900ff532128245a00c47c4f618d19209c00b1ab7a10d878ad242b57913e9b3c7f2b4db8bb01d66191183bafdcf4a1acc815c9
6
+ metadata.gz: 4a645755fe069b45ed3f07f02b742990acc25234214f3968e997b5c76475b70df1c3bccc400f6831aab1fc2a6770d409b3cedcb65f4dd7a36e38fdf0e2752bbe
7
+ data.tar.gz: 88a519d69bea0c6a08ea8ce6569468778e10431595e759f8e38ee4c049674125cef29f0425f83f59597ba3b62bd4c7d348c5bc5115b5213167414e1991626db4
@@ -8,6 +8,7 @@ module Dor
8
8
  # ids for previous and current catkeys
9
9
  CATKEY_TYPE_ID = 'catkey'
10
10
  PREVIOUS_CATKEY_TYPE_ID = 'previous_catkey'
11
+ BARCODE_TYPE_ID = 'barcode'
11
12
 
12
13
  set_terminology do |t|
13
14
  t.root(path: 'identityMetadata')
@@ -144,6 +145,25 @@ module Dor
144
145
  otherId(PREVIOUS_CATKEY_TYPE_ID)
145
146
  end
146
147
 
148
+ def barcode
149
+ otherId(BARCODE_TYPE_ID).first
150
+ end
151
+
152
+ # Convenience method to set the barcode
153
+ # @param [String] val the new barcode
154
+ # @return [String] same value, as per Ruby assignment convention
155
+ def barcode=(val)
156
+ if val.blank? # if we are setting the barcode to blank, remove the node from XML
157
+ remove_other_Id(BARCODE_TYPE_ID)
158
+ elsif barcode.blank? # if there is no current barcode, then add it
159
+ add_other_Id(BARCODE_TYPE_ID, val)
160
+ else # if there is a current barcode, update the current barcode to the new value
161
+ update_other_Id(BARCODE_TYPE_ID, val)
162
+ end
163
+
164
+ val
165
+ end
166
+
147
167
  # Helper method to get the release tags as a nodeset
148
168
  # @return [Nokogiri::XML::NodeSet] all release tags and their attributes
149
169
  def release_tags
@@ -76,7 +76,7 @@ module Dor
76
76
 
77
77
  delegate :full_title, :stanford_mods, to: :descMetadata
78
78
  delegate :rights, to: :rightsMetadata
79
- delegate :catkey, :catkey=, :source_id, :source_id=,
79
+ delegate :catkey, :catkey=, :source_id, :source_id=, :barcode, :barcode=,
80
80
  :objectId, :objectId=, :objectCreator, :objectCreator=,
81
81
  :objectLabel, :objectLabel=, :objectType, :objectType=,
82
82
  :other_ids=, :otherId, :release_tags, :previous_catkeys,
@@ -1,7 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'deprecation'
4
+
3
5
  module Dor
4
6
  class AdminPolicyObject < Dor::Abstract
7
+ extend Deprecation
5
8
  has_many :things, property: :is_governed_by, class_name: 'ActiveFedora::Base'
6
9
  has_object_type 'adminPolicy'
7
10
  has_metadata name: 'administrativeMetadata', type: Dor::AdministrativeMetadataDS, label: 'Administrative Metadata'
@@ -29,11 +32,13 @@ module Dor
29
32
  def agreement
30
33
  agreement_object ? agreement_object.pid : ''
31
34
  end
35
+ deprecation_deprecate agreement: 'use #agreement_object_id instead'
32
36
 
33
37
  def agreement=(val)
34
38
  raise ArgumentError, 'agreement must have a valid druid' if val.blank?
35
39
 
36
40
  self.agreement_object = Dor.find val.to_s, cast: true
37
41
  end
42
+ deprecation_deprecate :agreement= => 'use #agreement_object_id= instead'
38
43
  end
39
44
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dor
4
- VERSION = '9.4.0'
4
+ VERSION = '9.5.0'
5
5
  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: 9.4.0
4
+ version: 9.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Klein
@@ -20,7 +20,7 @@ authors:
20
20
  autorequire:
21
21
  bindir: bin
22
22
  cert_chain: []
23
- date: 2020-05-20 00:00:00.000000000 Z
23
+ date: 2020-05-28 00:00:00.000000000 Z
24
24
  dependencies:
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: active-fedora