cocina-models 0.87.1 → 0.88.0
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 +4 -4
- data/Gemfile.lock +6 -6
- data/lib/cocina/models/validators/catalog_links_validator.rb +17 -6
- data/lib/cocina/models/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc554199583e2b12406431ed5078bae08509c75989a7aafdcf22715530f3d5da
|
4
|
+
data.tar.gz: f2bd63b4b242d7f48156499fdf729935bccc728635c692628cd1e3ebb0c84cd5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: afaca98ac0c7260962d483ed4ff4bc0a4c9bf1c3aa538b1571541b98b2ef6d6efd9a00e0575fffd3117adc8dbd75426b4e4dffeb1ebfae4a46fa0db1c1a3e3b1
|
7
|
+
data.tar.gz: '090a1137f535c219c96966b44a8af03a9a60bdf9dd871c4b6024a033d4323ffc3f000132835d71d55aa60a80f38b7601663b6403b05e6df69a699395ccdf9f99'
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
cocina-models (0.
|
4
|
+
cocina-models (0.88.0)
|
5
5
|
activesupport
|
6
6
|
deprecation
|
7
7
|
dry-struct (~> 1.0)
|
@@ -51,11 +51,11 @@ GEM
|
|
51
51
|
dry-types (>= 1.7, < 2)
|
52
52
|
ice_nine (~> 0.11)
|
53
53
|
zeitwerk (~> 2.6)
|
54
|
-
dry-types (1.7.
|
54
|
+
dry-types (1.7.1)
|
55
55
|
concurrent-ruby (~> 1.0)
|
56
|
-
dry-core (~> 1.0
|
57
|
-
dry-inflector (~> 1.0
|
58
|
-
dry-logic (
|
56
|
+
dry-core (~> 1.0)
|
57
|
+
dry-inflector (~> 1.0)
|
58
|
+
dry-logic (~> 1.4)
|
59
59
|
zeitwerk (~> 2.6)
|
60
60
|
edtf (3.1.1)
|
61
61
|
activesupport (>= 3.0, < 8.0)
|
@@ -118,7 +118,7 @@ GEM
|
|
118
118
|
unicode-display_width (>= 2.4.0, < 3.0)
|
119
119
|
rubocop-ast (1.26.0)
|
120
120
|
parser (>= 3.2.1.0)
|
121
|
-
rubocop-capybara (2.17.
|
121
|
+
rubocop-capybara (2.17.1)
|
122
122
|
rubocop (~> 1.41)
|
123
123
|
rubocop-rake (0.6.0)
|
124
124
|
rubocop (~> 1.0)
|
@@ -19,22 +19,33 @@ module Cocina
|
|
19
19
|
def validate
|
20
20
|
return unless meets_preconditions?
|
21
21
|
|
22
|
+
validate_catalog('symphony')
|
23
|
+
validate_catalog('folio')
|
24
|
+
end
|
25
|
+
|
26
|
+
private
|
27
|
+
|
28
|
+
attr_reader :clazz, :attributes
|
29
|
+
|
30
|
+
def validate_catalog(catalog)
|
31
|
+
refresh_catalog_links = refresh_catalog_links_for(catalog)
|
32
|
+
|
22
33
|
return if refresh_catalog_links.length <= MAX_REFRESH_CATALOG_LINKS
|
23
34
|
|
24
35
|
raise ValidationError, "Multiple catalog links have 'refresh' property set to true " \
|
25
36
|
"(only one allowed) #{refresh_catalog_links}"
|
26
37
|
end
|
27
38
|
|
28
|
-
|
29
|
-
|
30
|
-
|
39
|
+
def catalog_links
|
40
|
+
@catalog_links ||= Array(attributes.dig(:identification, :catalogLinks))
|
41
|
+
end
|
31
42
|
|
32
43
|
def meets_preconditions?
|
33
|
-
(dro? || collection?) &&
|
44
|
+
(dro? || collection?) && catalog_links.any?
|
34
45
|
end
|
35
46
|
|
36
|
-
def
|
37
|
-
|
47
|
+
def refresh_catalog_links_for(catalog)
|
48
|
+
catalog_links.select { |catalog_link| catalog_link[:catalog] == catalog && catalog_link[:refresh] }
|
38
49
|
end
|
39
50
|
|
40
51
|
def dro?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocina-models
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.88.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Coyne
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-02-
|
11
|
+
date: 2023-02-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -531,7 +531,7 @@ homepage: https://github.com/sul-dlss/cocina-models
|
|
531
531
|
licenses: []
|
532
532
|
metadata:
|
533
533
|
rubygems_mfa_required: 'true'
|
534
|
-
post_install_message:
|
534
|
+
post_install_message:
|
535
535
|
rdoc_options: []
|
536
536
|
require_paths:
|
537
537
|
- lib
|
@@ -547,7 +547,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
547
547
|
version: '0'
|
548
548
|
requirements: []
|
549
549
|
rubygems_version: 3.3.7
|
550
|
-
signing_key:
|
550
|
+
signing_key:
|
551
551
|
specification_version: 4
|
552
552
|
summary: Data models for the SDR
|
553
553
|
test_files: []
|