active-fedora 13.2.3 → 13.2.4

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: f8d29a02255da46716747bba4708f04e209adac4000d05c85a79b89facbfd36f
4
- data.tar.gz: aedc7dbe3a0ac8254487860560ade6497913c3f246eb544c737eda1904ddcbf5
3
+ metadata.gz: 85c4c145c52dd7a76031180b40c4a9d8d2cca56073178db2d7543264ff76afea
4
+ data.tar.gz: 5e89813a2fb65dcd80487a1203bec8ca869cc3c611924440903cb22830133dcb
5
5
  SHA512:
6
- metadata.gz: 7f407c3923265fefa18ade5f35f71bc8a79171f7959aa877b1c5b49f1422ebb181e47eef5d13ca919f154383d7e2e540aba133ebe801fac7b289bce44702c804
7
- data.tar.gz: 2e0de1699f5fb864e03ade7cfefcabf770d14d7935c0431e12a924479e96330906ebc1daf618135279ba9d09a79dd892aeb356281fef90455b9c3e8131f52a56
6
+ metadata.gz: 8e97b32bca2819b43732657cd70b3cbb6f932b144bf00c10f390a0caee675b59a6f480637ff0fe93ad0f1b8bcfa791d1298a8dedf580b59699ff74ad8dd31240
7
+ data.tar.gz: 4ca64c09d2b36a4378303ccd5cb257d0012207c44793bf93cac44be0dda1a230e87066ff19664f91d36ac42367b2539484b512012b5cdee071ae728fe399e811
@@ -62,6 +62,9 @@ module ActiveFedora
62
62
  refresh
63
63
  load_attached_files
64
64
  self
65
+ rescue Ldp::Gone => err
66
+ logger.error("Tried to reload an object that has been destroyed.\n\t#{err.message}")
67
+ raise ActiveFedora::ObjectNotFoundError
65
68
  end
66
69
 
67
70
  # Initialize an empty model object and set its +resource+
@@ -59,8 +59,8 @@ module ActiveFedora
59
59
 
60
60
  add_self_to_partitioned_uris unless @exclude_self
61
61
 
62
- immediate_descendant_uris = rdf_graph.query(predicate: ::RDF::Vocab::LDP.contains).map { |descendant| descendant.object.to_s }
63
- immediate_descendant_uris.each do |descendant_uri|
62
+ rdf_graph.query(predicate: ::RDF::Vocab::LDP.contains).each_object do |uri|
63
+ descendant_uri = uri.to_s
64
64
  self.class.new(
65
65
  descendant_uri,
66
66
  priority_models: priority_models
@@ -88,16 +88,12 @@ module ActiveFedora
88
88
  @partitioned_uris ||= {}
89
89
  end
90
90
 
91
- def rdf_graph_models
92
- rdf_graph.query(predicate: HAS_MODEL_PREDICATE).collect(&:object).collect do |rdf_object|
93
- rdf_object.to_s if rdf_object.literal?
94
- end.compact
95
- end
96
-
97
91
  def add_self_to_partitioned_uris
98
- rdf_graph_models.each do |model|
99
- partitioned_uris[model] ||= []
100
- partitioned_uris[model] << rdf_resource.subject
92
+ rdf_graph.query(predicate: HAS_MODEL_PREDICATE).each_object do |model|
93
+ next unless model.literal?
94
+
95
+ partitioned_uris[model.to_s] ||= []
96
+ partitioned_uris[model.to_s] << rdf_resource.subject
101
97
  end
102
98
  end
103
99
  end
@@ -20,5 +20,11 @@ module ActiveFedora
20
20
  def marshal_load(data)
21
21
  data.each { |name, val| instance_variable_set(name, val) }
22
22
  end
23
+
24
+ private
25
+
26
+ def response_as_graph(resp)
27
+ graph_class.new(subject_uri, data: resp.graph.data)
28
+ end
23
29
  end
24
30
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActiveFedora
4
- VERSION = '13.2.3'
4
+ VERSION = '13.2.4'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active-fedora
3
3
  version: !ruby/object:Gem::Version
4
- version: 13.2.3
4
+ version: 13.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Zumwalt
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2020-11-13 00:00:00.000000000 Z
13
+ date: 2021-05-17 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activemodel