active-fedora 9.0.0.rc3 → 9.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/History.txt +1054 -0
  3. data/active-fedora.gemspec +1 -1
  4. data/config/predicate_mappings.yml +2 -2
  5. data/lib/active_fedora.rb +3 -0
  6. data/lib/active_fedora/attached_files.rb +31 -14
  7. data/lib/active_fedora/base.rb +2 -0
  8. data/lib/active_fedora/caching_connection.rb +80 -0
  9. data/lib/active_fedora/callbacks.rb +13 -14
  10. data/lib/active_fedora/core.rb +9 -17
  11. data/lib/active_fedora/errors.rb +1 -1
  12. data/lib/active_fedora/fedora.rb +5 -1
  13. data/lib/active_fedora/file.rb +42 -39
  14. data/lib/active_fedora/ldp_cache.rb +46 -0
  15. data/lib/active_fedora/ldp_resource_service.rb +27 -0
  16. data/lib/active_fedora/loadable_from_json.rb +3 -1
  17. data/lib/active_fedora/log_subscriber.rb +38 -0
  18. data/lib/active_fedora/persistence.rb +22 -12
  19. data/lib/active_fedora/predicates.rb +3 -3
  20. data/lib/active_fedora/railtie.rb +3 -0
  21. data/lib/active_fedora/rdf.rb +0 -1
  22. data/lib/active_fedora/relation/finder_methods.rb +2 -3
  23. data/lib/active_fedora/validations.rb +1 -3
  24. data/lib/active_fedora/version.rb +1 -1
  25. data/lib/generators/active_fedora/config/solr/templates/jetty.yml +3 -2
  26. data/spec/fixtures/rails_root/config/predicate_mappings.yml +2 -2
  27. data/spec/integration/associations_spec.rb +19 -19
  28. data/spec/integration/attached_files_spec.rb +3 -3
  29. data/spec/integration/belongs_to_association_spec.rb +9 -9
  30. data/spec/integration/caching_spec.rb +59 -0
  31. data/spec/integration/collection_association_spec.rb +1 -1
  32. data/spec/integration/fedora_solr_sync_spec.rb +2 -2
  33. data/spec/integration/file_spec.rb +41 -43
  34. data/spec/integration/has_and_belongs_to_many_associations_spec.rb +8 -8
  35. data/spec/integration/has_many_associations_spec.rb +15 -15
  36. data/spec/integration/nested_attribute_spec.rb +2 -2
  37. data/spec/integration/relation_spec.rb +1 -1
  38. data/spec/integration/solr_instance_loader_spec.rb +2 -1
  39. data/spec/samples/special_thing.rb +2 -2
  40. data/spec/spec_helper.rb +1 -0
  41. data/spec/unit/attached_files_spec.rb +41 -5
  42. data/spec/unit/attributes_spec.rb +1 -1
  43. data/spec/unit/change_set_spec.rb +1 -1
  44. data/spec/unit/code_configurator_spec.rb +3 -3
  45. data/spec/unit/core_spec.rb +16 -1
  46. data/spec/unit/file_spec.rb +14 -10
  47. data/spec/unit/has_and_belongs_to_many_association_spec.rb +6 -6
  48. data/spec/unit/has_many_association_spec.rb +4 -4
  49. data/spec/unit/indexing_service_spec.rb +2 -2
  50. data/spec/unit/ldp_resource_spec.rb +17 -0
  51. data/spec/unit/logger_spec.rb +1 -1
  52. data/spec/unit/persistence_spec.rb +24 -20
  53. data/spec/unit/predicates_spec.rb +7 -7
  54. data/spec/unit/sparql_insert_spec.rb +2 -2
  55. data/spec/unit/validations_spec.rb +12 -2
  56. metadata +13 -8
  57. data/lib/active_fedora/rdf/rels_ext.rb +0 -26
@@ -56,7 +56,7 @@ describe ActiveFedora::AttachedFiles do
56
56
  def load_attached_files
57
57
  super
58
58
  unless attached_files.keys.include? :test_ds
59
- add_file_datastream("XXX", dsid: 'test_ds', mime_type: 'text/html')
59
+ add_file("XXX", path: 'test_ds', mime_type: 'text/html')
60
60
  end
61
61
  end
62
62
  end
@@ -120,10 +120,10 @@ describe ActiveFedora::AttachedFiles do
120
120
  end
121
121
  end
122
122
 
123
- describe '.add_file_datastream' do
123
+ describe '#add_file' do
124
124
  before do
125
125
  f = File.new(File.join( File.dirname(__FILE__), "../fixtures/dino_jpg_no_file_ext" ))
126
- obj.add_file_datastream(f, mime_type: "image/jpeg")
126
+ obj.add_file(f, mime_type: "image/jpeg")
127
127
  obj.save
128
128
  end
129
129
 
@@ -7,7 +7,7 @@ describe ActiveFedora::Base do
7
7
  end
8
8
 
9
9
  class Book < ActiveFedora::Base
10
- belongs_to :library, predicate: ActiveFedora::RDF::RelsExt.hasConstituent
10
+ belongs_to :library, predicate: ActiveFedora::RDF::Fcrepo::RelsExt.hasConstituent
11
11
  end
12
12
  class SpecialInheritedBook < Book
13
13
  end
@@ -86,23 +86,23 @@ describe ActiveFedora::Base do
86
86
  describe "casting inheritance detailed test cases" do
87
87
  before :all do
88
88
  class SimpleObject < ActiveFedora::Base
89
- belongs_to :simple_collection, predicate: ActiveFedora::RDF::RelsExt.isPartOf, class_name: 'SimpleCollection'
90
- belongs_to :complex_collection, predicate: ActiveFedora::RDF::RelsExt.isPartOf, class_name: 'ComplexCollection'
89
+ belongs_to :simple_collection, predicate: ActiveFedora::RDF::Fcrepo::RelsExt.isPartOf, class_name: 'SimpleCollection'
90
+ belongs_to :complex_collection, predicate: ActiveFedora::RDF::Fcrepo::RelsExt.isPartOf, class_name: 'ComplexCollection'
91
91
  end
92
92
 
93
93
  class ComplexObject < SimpleObject
94
- belongs_to :simple_collection, predicate: ActiveFedora::RDF::RelsExt.isPartOf, class_name: 'SimpleCollection'
95
- belongs_to :complex_collection, predicate: ActiveFedora::RDF::RelsExt.isPartOf, class_name: 'ComplexCollection'
94
+ belongs_to :simple_collection, predicate: ActiveFedora::RDF::Fcrepo::RelsExt.isPartOf, class_name: 'SimpleCollection'
95
+ belongs_to :complex_collection, predicate: ActiveFedora::RDF::Fcrepo::RelsExt.isPartOf, class_name: 'ComplexCollection'
96
96
  end
97
97
 
98
98
  class SimpleCollection < ActiveFedora::Base
99
- has_many :objects, predicate: ActiveFedora::RDF::RelsExt.isPartOf, class_name: 'SimpleObject', autosave: true
100
- has_many :complex_objects, predicate: ActiveFedora::RDF::RelsExt.isPartOf, class_name: 'ComplexObject', autosave: true
99
+ has_many :objects, predicate: ActiveFedora::RDF::Fcrepo::RelsExt.isPartOf, class_name: 'SimpleObject', autosave: true
100
+ has_many :complex_objects, predicate: ActiveFedora::RDF::Fcrepo::RelsExt.isPartOf, class_name: 'ComplexObject', autosave: true
101
101
  end
102
102
 
103
103
  class ComplexCollection < SimpleCollection
104
- has_many :objects, predicate: ActiveFedora::RDF::RelsExt.isPartOf, class_name: 'SimpleObject', autosave: true
105
- has_many :complex_objects, predicate: ActiveFedora::RDF::RelsExt.isPartOf, class_name: 'ComplexObject', autosave: true
104
+ has_many :objects, predicate: ActiveFedora::RDF::Fcrepo::RelsExt.isPartOf, class_name: 'SimpleObject', autosave: true
105
+ has_many :complex_objects, predicate: ActiveFedora::RDF::Fcrepo::RelsExt.isPartOf, class_name: 'ComplexObject', autosave: true
106
106
  end
107
107
 
108
108
  end
@@ -0,0 +1,59 @@
1
+ require 'spec_helper'
2
+
3
+ describe "Caching" do
4
+ before do
5
+ class TestClass < ActiveFedora::Base
6
+ property :title, predicate: ::RDF::DC.title
7
+ end
8
+ end
9
+
10
+ after { Object.send(:remove_const, :TestClass) }
11
+
12
+ let!(:object) { TestClass.create(id: '123') }
13
+
14
+ describe "#cache" do
15
+ it "should find records in the cache" do
16
+ expect_any_instance_of(Faraday::Connection).to receive(:get).once.and_call_original
17
+ ActiveFedora::Base.cache do
18
+ o1 = TestClass.find(object.id)
19
+ o2 = TestClass.find(object.id)
20
+ expect(o1.ldp_source.get.body.object_id).to eq o2.ldp_source.get.body.object_id
21
+ end
22
+ end
23
+
24
+ it "should clear the cache at the end of the block" do
25
+ expect_any_instance_of(Faraday::Connection).to receive(:get).twice.and_call_original
26
+ ActiveFedora::Base.cache do
27
+ TestClass.find(object.id)
28
+ end
29
+ ActiveFedora::Base.cache do
30
+ TestClass.find(object.id)
31
+ end
32
+ end
33
+
34
+ context "an update" do
35
+ it "should flush the cache" do
36
+ expect_any_instance_of(Faraday::Connection).to receive(:get).twice.and_call_original
37
+ ActiveFedora::Base.cache do
38
+ TestClass.find(object.id)
39
+ object.title= ['foo']
40
+ object.save!
41
+ TestClass.find(object.id)
42
+ end
43
+ end
44
+ end
45
+ end
46
+
47
+ describe "#uncached" do
48
+ it "should not use the cache" do
49
+ expect_any_instance_of(Faraday::Connection).to receive(:get).twice.and_call_original
50
+ ActiveFedora::Base.cache do
51
+ TestClass.find(object.id)
52
+ ActiveFedora::Base.uncached do
53
+ TestClass.find(object.id)
54
+ end
55
+ TestClass.find(object.id)
56
+ end
57
+ end
58
+ end
59
+ end
@@ -6,7 +6,7 @@ describe ActiveFedora::Base do
6
6
  has_many :books
7
7
  end
8
8
  class Book < ActiveFedora::Base
9
- belongs_to :library, predicate: ActiveFedora::RDF::RelsExt.hasMember
9
+ belongs_to :library, predicate: ActiveFedora::RDF::Fcrepo::RelsExt.hasMember
10
10
  end
11
11
  end
12
12
 
@@ -4,11 +4,11 @@ require 'timeout'
4
4
  describe "fedora_solr_sync_issues" do
5
5
  before :all do
6
6
  class ParentThing < ActiveFedora::Base
7
- has_many :things, :class_name=>'ChildThing', predicate: ActiveFedora::RDF::RelsExt.isPartOf
7
+ has_many :things, :class_name=>'ChildThing', predicate: ActiveFedora::RDF::Fcrepo::RelsExt.isPartOf
8
8
  end
9
9
 
10
10
  class ChildThing < ActiveFedora::Base
11
- belongs_to :parent, :class_name=>'ParentThing', predicate: ActiveFedora::RDF::RelsExt.isPartOf
11
+ belongs_to :parent, :class_name=>'ParentThing', predicate: ActiveFedora::RDF::Fcrepo::RelsExt.isPartOf
12
12
  end
13
13
  end
14
14
 
@@ -4,64 +4,62 @@ require 'active_fedora'
4
4
  require "rexml/document"
5
5
 
6
6
  describe ActiveFedora::File do
7
- context "stand alone operation" do
8
- it "should save" do
9
- subject.content = "some stuff"
10
- subject.save
11
- expect(subject).not_to be_new_record
7
+ describe "#save" do
8
+ context "with a string" do
9
+ it "should save" do
10
+ subject.content = "some stuff"
11
+ subject.save
12
+ expect(subject).not_to be_new_record
13
+ end
12
14
  end
13
- end
14
15
 
15
- context "stand alone operation with UploadedFile" do
16
- before(:all) do
17
- module ActionDispatch
18
- module Http
19
- class UploadedFile
16
+ context "with UploadedFile" do
17
+ before do
18
+ module ActionDispatch
19
+ module Http
20
+ class UploadedFile
20
21
 
21
- def initialize
22
- @content = StringIO.new("hello world")
23
- end
22
+ def initialize
23
+ @content = StringIO.new("hello world")
24
+ end
24
25
 
25
- def read(a, b)
26
- return @content.read(a, b)
27
- end
28
-
29
- def size
30
- @content.length
31
- end
26
+ def read(a, b)
27
+ return @content.read(a, b)
28
+ end
29
+
30
+ def size
31
+ @content.length
32
+ end
32
33
 
34
+ end
33
35
  end
34
36
  end
35
37
  end
36
- end
37
38
 
38
- it "should save" do
39
- subject.content = ActionDispatch::Http::UploadedFile.new
40
- subject.save
41
- expect(subject).not_to be_new_record
39
+ it "should save" do
40
+ subject.content = ActionDispatch::Http::UploadedFile.new
41
+ subject.save
42
+ expect(subject).not_to be_new_record
43
+ end
42
44
  end
43
45
  end
44
46
 
45
47
  context "when autocreate is true" do
46
- before(:all) do
48
+ before do
47
49
  class MockAFBase < ActiveFedora::Base
48
50
  has_metadata "descMetadata", type: ActiveFedora::QualifiedDublinCoreDatastream, autocreate: true
49
51
  end
50
52
  end
51
53
 
52
- after(:all) do
54
+ after do
53
55
  Object.send(:remove_const, :MockAFBase)
54
56
  end
55
57
 
56
58
  let(:test_object) { MockAFBase.create }
57
59
 
58
- after do
59
- test_object.destroy
60
- end
61
-
62
60
  let(:descMetadata) { test_object.attached_files["descMetadata"] }
63
61
 
64
- describe "the datastream" do
62
+ describe "the metadata file" do
65
63
  subject { descMetadata }
66
64
  it { should be_a_kind_of(ActiveFedora::File) }
67
65
  end
@@ -77,7 +75,7 @@ describe ActiveFedora::File do
77
75
  end
78
76
 
79
77
 
80
- context "an XML datastream" do
78
+ context "an XML file" do
81
79
  let(:xml_content) { Nokogiri::XML::Document.parse(descMetadata.content) }
82
80
  let(:title) { Nokogiri::XML::Element.new "title", xml_content }
83
81
  before do
@@ -95,38 +93,38 @@ describe ActiveFedora::File do
95
93
  it { should eq title.content }
96
94
  end
97
95
 
98
- context "a blob datastream" do
99
- let(:dsid) { "ds#{Time.now.to_i}" }
96
+ context "a binary file" do
97
+ let(:path) { "ds#{Time.now.to_i}" }
100
98
  let(:content) { fixture('dino.jpg') }
101
- let(:datastream) { ActiveFedora::File.new.tap { |ds| ds.content = content } }
99
+ let(:file) { ActiveFedora::File.new.tap { |ds| ds.content = content } }
102
100
 
103
101
  before do
104
- test_object.attach_file(datastream, dsid)
102
+ test_object.attach_file(file, path)
105
103
  test_object.save
106
104
  end
107
105
 
108
106
  it "should not be changed" do
109
- expect(test_object.attached_files[dsid]).to_not be_changed
107
+ expect(test_object.attached_files[path]).to_not be_changed
110
108
  end
111
109
 
112
110
  it "should be able to read the content from fedora" do
113
111
  content.rewind
114
- expect(test_object.attached_files[dsid].content).to eq content.read
112
+ expect(test_object.attached_files[path].content).to eq content.read
115
113
  end
116
114
 
117
115
  describe "streaming the response" do
118
116
  let(:stream_reader) { double }
119
117
  it "should stream the response" do
120
118
  expect(stream_reader).to receive(:read).at_least(:once)
121
- test_object.attached_files[dsid].stream { |buff| stream_reader.read(buff) }
119
+ test_object.attached_files[path].stream.each { |buff| stream_reader.read(buff) }
122
120
  end
123
121
 
124
122
  context "with a range request" do
125
123
  before do
126
- test_object.add_file_datastream('one1two2threfour', dsid: 'webm', mime_type: 'video/webm')
124
+ test_object.add_file('one1two2threfour', path: 'webm', mime_type: 'video/webm')
127
125
  test_object.save!
128
126
  end
129
- subject { str = ''; test_object.webm.stream(range) {|chunk| str << chunk }; str }
127
+ subject { str = ''; test_object.webm.stream(range).each {|chunk| str << chunk }; str }
130
128
  context "whole thing" do
131
129
  let(:range) { 'bytes=0-15' }
132
130
  it { should eq 'one1two2threfour'}
@@ -5,7 +5,7 @@ describe ActiveFedora::Base do
5
5
  before do
6
6
  class Book < ActiveFedora::Base
7
7
  has_and_belongs_to_many :topics, predicate: ::RDF::FOAF.primaryTopic, inverse_of: :books
8
- has_and_belongs_to_many :collections, predicate: ActiveFedora::RDF::RelsExt.isMemberOfCollection
8
+ has_and_belongs_to_many :collections, predicate: ActiveFedora::RDF::Fcrepo::RelsExt.isMemberOfCollection
9
9
  end
10
10
 
11
11
  class SpecialInheritedBook < Book
@@ -113,11 +113,11 @@ describe ActiveFedora::Base do
113
113
  describe "when inverse is not specified" do
114
114
  before do
115
115
  class Book < ActiveFedora::Base
116
- has_and_belongs_to_many :collections, predicate: ActiveFedora::RDF::RelsExt.isMemberOfCollection
116
+ has_and_belongs_to_many :collections, predicate: ActiveFedora::RDF::Fcrepo::RelsExt.isMemberOfCollection
117
117
  end
118
118
 
119
119
  class Collection < ActiveFedora::Base
120
- has_and_belongs_to_many :books, predicate: ActiveFedora::RDF::RelsExt.isMemberOfCollection
120
+ has_and_belongs_to_many :books, predicate: ActiveFedora::RDF::Fcrepo::RelsExt.isMemberOfCollection
121
121
  end
122
122
  end
123
123
 
@@ -166,7 +166,7 @@ describe ActiveFedora::Base do
166
166
  describe "without callbacks" do
167
167
  before do
168
168
  class Book < ActiveFedora::Base
169
- has_and_belongs_to_many :collections, predicate: ActiveFedora::RDF::RelsExt.isMemberOfCollection
169
+ has_and_belongs_to_many :collections, predicate: ActiveFedora::RDF::Fcrepo::RelsExt.isMemberOfCollection
170
170
  end
171
171
 
172
172
  class Collection < ActiveFedora::Base
@@ -211,7 +211,7 @@ describe ActiveFedora::Base do
211
211
  before do
212
212
  class Book < ActiveFedora::Base
213
213
  has_and_belongs_to_many :collections,
214
- predicate: ActiveFedora::RDF::RelsExt.isMemberOfCollection,
214
+ predicate: ActiveFedora::RDF::Fcrepo::RelsExt.isMemberOfCollection,
215
215
  before_remove: :foo, after_remove: :bar
216
216
  end
217
217
 
@@ -258,7 +258,7 @@ describe ActiveFedora::Base do
258
258
  before do
259
259
  class Book < ActiveFedora::Base
260
260
  has_and_belongs_to_many :collections,
261
- predicate: ActiveFedora::RDF::RelsExt.isMemberOfCollection,
261
+ predicate: ActiveFedora::RDF::Fcrepo::RelsExt.isMemberOfCollection,
262
262
  before_add: :foo, after_add: :bar
263
263
  end
264
264
 
@@ -302,7 +302,7 @@ end
302
302
  describe "create" do
303
303
  before do
304
304
  class Book < ActiveFedora::Base
305
- has_and_belongs_to_many :collections, predicate: ActiveFedora::RDF::RelsExt.isMemberOfCollection
305
+ has_and_belongs_to_many :collections, predicate: ActiveFedora::RDF::Fcrepo::RelsExt.isMemberOfCollection
306
306
  end
307
307
 
308
308
  class Collection < ActiveFedora::Base
@@ -338,7 +338,7 @@ describe "Autosave" do
338
338
  end
339
339
 
340
340
  class Component < ActiveFedora::Base
341
- has_and_belongs_to_many :items, predicate: ActiveFedora::RDF::RelsExt.isPartOf
341
+ has_and_belongs_to_many :items, predicate: ActiveFedora::RDF::Fcrepo::RelsExt.isPartOf
342
342
  has_metadata "foo", type: ActiveFedora::SimpleDatastream do |m|
343
343
  m.field "description", :string
344
344
  end
@@ -7,7 +7,7 @@ describe "Collection members" do
7
7
  end
8
8
 
9
9
  class Book < ActiveFedora::Base
10
- belongs_to :library, predicate: ActiveFedora::RDF::RelsExt.hasConstituent
10
+ belongs_to :library, predicate: ActiveFedora::RDF::Fcrepo::RelsExt.hasConstituent
11
11
  end
12
12
  end
13
13
  after :all do
@@ -69,7 +69,7 @@ describe "After save callbacks" do
69
69
  end
70
70
 
71
71
  class Book < ActiveFedora::Base
72
- belongs_to :library, predicate: ActiveFedora::RDF::RelsExt.hasConstituent
72
+ belongs_to :library, predicate: ActiveFedora::RDF::Fcrepo::RelsExt.hasConstituent
73
73
  after_save :find_self
74
74
  attr_accessor :library_books
75
75
 
@@ -101,11 +101,11 @@ describe "When two or more relationships share the same property" do
101
101
  end
102
102
 
103
103
  class Person < ActiveFedora::Base
104
- belongs_to :book, predicate: ActiveFedora::RDF::RelsExt.isPartOf
104
+ belongs_to :book, predicate: ActiveFedora::RDF::Fcrepo::RelsExt.isPartOf
105
105
  end
106
106
 
107
107
  class Collection < ActiveFedora::Base
108
- belongs_to :book, predicate: ActiveFedora::RDF::RelsExt.isPartOf
108
+ belongs_to :book, predicate: ActiveFedora::RDF::Fcrepo::RelsExt.isPartOf
109
109
  end
110
110
 
111
111
  @book = Book.create!
@@ -128,14 +128,14 @@ end
128
128
  describe "with an polymorphic association" do
129
129
  before do
130
130
  class Permissionable1 < ActiveFedora::Base
131
- has_many :permissions, predicate: ActiveFedora::RDF::RelsExt.isPartOf, inverse_of: :access_to
131
+ has_many :permissions, predicate: ActiveFedora::RDF::Fcrepo::RelsExt.isPartOf, inverse_of: :access_to
132
132
  end
133
133
  class Permissionable2 < ActiveFedora::Base
134
- has_many :permissions, predicate: ActiveFedora::RDF::RelsExt.isPartOf, inverse_of: :access_to
134
+ has_many :permissions, predicate: ActiveFedora::RDF::Fcrepo::RelsExt.isPartOf, inverse_of: :access_to
135
135
  end
136
136
 
137
137
  class Permission < ActiveFedora::Base
138
- belongs_to :access_to, predicate: ActiveFedora::RDF::RelsExt.isPartOf, class_name: 'ActiveFedora::Base'
138
+ belongs_to :access_to, predicate: ActiveFedora::RDF::Fcrepo::RelsExt.isPartOf, class_name: 'ActiveFedora::Base'
139
139
  end
140
140
  end
141
141
 
@@ -155,15 +155,15 @@ end
155
155
  describe "When relationship is restricted to AF::Base" do
156
156
  before do
157
157
  class Email < ActiveFedora::Base
158
- has_many :attachments, predicate: ActiveFedora::RDF::RelsExt.isPartOf, :class_name=>'ActiveFedora::Base'
158
+ has_many :attachments, predicate: ActiveFedora::RDF::Fcrepo::RelsExt.isPartOf, :class_name=>'ActiveFedora::Base'
159
159
  end
160
160
 
161
161
  class Image < ActiveFedora::Base
162
- belongs_to :email, predicate: ActiveFedora::RDF::RelsExt.isPartOf
162
+ belongs_to :email, predicate: ActiveFedora::RDF::Fcrepo::RelsExt.isPartOf
163
163
  end
164
164
 
165
165
  class PDF < ActiveFedora::Base
166
- belongs_to :email, predicate: ActiveFedora::RDF::RelsExt.isPartOf
166
+ belongs_to :email, predicate: ActiveFedora::RDF::Fcrepo::RelsExt.isPartOf
167
167
  end
168
168
  end
169
169
 
@@ -211,7 +211,7 @@ describe "Deleting a dependent relationship" do
211
211
  has_many :components
212
212
  end
213
213
  class Component < ActiveFedora::Base
214
- belongs_to :item, predicate: ActiveFedora::RDF::RelsExt.isPartOf
214
+ belongs_to :item, predicate: ActiveFedora::RDF::Fcrepo::RelsExt.isPartOf
215
215
  end
216
216
  end
217
217
 
@@ -279,7 +279,7 @@ describe "Autosave" do
279
279
  has_attributes :title, datastream: 'foo'
280
280
  end
281
281
  class Component < ActiveFedora::Base
282
- belongs_to :item, predicate: ActiveFedora::RDF::RelsExt.isPartOf
282
+ belongs_to :item, predicate: ActiveFedora::RDF::Fcrepo::RelsExt.isPartOf
283
283
  has_metadata "foo", type: ActiveFedora::SimpleDatastream do |m|
284
284
  m.field "description", :string
285
285
  end
@@ -315,11 +315,11 @@ describe "Autosave" do
315
315
  context "with ActiveFedora::Base as classes" do
316
316
  before do
317
317
  class Novel < ActiveFedora::Base
318
- has_many :books, predicate: ActiveFedora::RDF::RelsExt.isPartOf, class_name: 'ActiveFedora::Base'
319
- has_and_belongs_to_many :contents, predicate: ActiveFedora::RDF::RelsExt.isPartOf, class_name: 'ActiveFedora::Base'
318
+ has_many :books, predicate: ActiveFedora::RDF::Fcrepo::RelsExt.isPartOf, class_name: 'ActiveFedora::Base'
319
+ has_and_belongs_to_many :contents, predicate: ActiveFedora::RDF::Fcrepo::RelsExt.isPartOf, class_name: 'ActiveFedora::Base'
320
320
  end
321
321
  class Text < ActiveFedora::Base
322
- has_many :books, predicate: ActiveFedora::RDF::RelsExt.isPartOf, class_name: 'ActiveFedora::Base'
322
+ has_many :books, predicate: ActiveFedora::RDF::Fcrepo::RelsExt.isPartOf, class_name: 'ActiveFedora::Base'
323
323
  end
324
324
  end
325
325
  let(:text) { Text.create}