active-fedora 11.1.3 → 11.1.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
  SHA1:
3
- metadata.gz: 6fbb07414e2177fa95ea8349817976b1b37a765c
4
- data.tar.gz: 6d2310b2bd54270c779e9f3c183b3aad790b68ad
3
+ metadata.gz: 680a242f0b724c0f1159629c8881a1e90df14f85
4
+ data.tar.gz: 9631a6201e7c3cf4c76c6fa1688c0087af8377ca
5
5
  SHA512:
6
- metadata.gz: 4fa39573b64bac45e116fbe334e657ef3f1b01e15a8a93cade30080c4d55fa2628e2b5de5bb15482880951f401fcea90b5736744ee141190f4ee03847015edd0
7
- data.tar.gz: 14bf26166bc2d0a1e52455686a952922748036d3dd6a756be9e9264c3802032420ce0a0ddc608dcbb49050cea8d26ac3e339b38e3250b2177df4718e1eea2592
6
+ metadata.gz: c43409e731c3d9d9e1dc7b0d785ba233a33fe3f5204c49914a3c1bbd1aa29b4bb065bbad994c3cf97b382a0c89f685b8670c89689abb47d8d6433dc82094f051
7
+ data.tar.gz: f6227e309593c643a0d2d7234925478a869e99c1acd07f0376e2a81cf588373ebbea25af536ac9a30cc729b60fa21b56bc95c79659559c845420261baa8f9dfa
@@ -33,7 +33,11 @@ module ActiveFedora
33
33
  resource.query(subject: resource, predicate: ::RDF::Vocab::LDP.contains).objects.map(&:to_s)
34
34
  end
35
35
 
36
+ # Load any undeclared relationships or has_subresource relationships. These are non-idiomatic LDP
37
+ # because we are going to find the subresource by knowing it's subpath ahead of time.
38
+ # Does nothing if this object is using idiomatic basic containment, by declaring `is_a_container`
36
39
  def load_attached_files
40
+ return if reflections[:contains] && reflections[:contains].macro == :is_a_container
37
41
  contains_assertions.each do |file_uri|
38
42
  path = file_uri.to_s.sub(uri + '/', '')
39
43
  next if association(path.to_sym)
@@ -1,3 +1,3 @@
1
1
  module ActiveFedora
2
- VERSION = "11.1.3".freeze
2
+ VERSION = "11.1.4".freeze
3
3
  end
@@ -187,4 +187,27 @@ describe ActiveFedora::AttachedFiles do
187
187
  expect(af_base.metadata_streams).to_not include(file_ds)
188
188
  end
189
189
  end
190
+
191
+ context "When the resource is using idiomatic basic containment" do
192
+ before do
193
+ class Sample1 < ActiveFedora::Base
194
+ is_a_container
195
+ end
196
+ end
197
+ after do
198
+ Object.send(:remove_const, :Sample1)
199
+ end
200
+
201
+ before do
202
+ child = obj.contains.build
203
+ child.content = "Stuff"
204
+ child.save!
205
+ end
206
+ let(:obj) { Sample1.create! }
207
+ let(:obj2) { Sample1.find(obj.id) }
208
+
209
+ it "doesn't conflate attached_file and contains" do
210
+ expect(obj2.attached_files.keys).to be_empty
211
+ end
212
+ end
190
213
  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: 11.1.3
4
+ version: 11.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Zumwalt