active-fedora 9.1.2 → 9.2.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (101) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -1
  3. data/Gemfile +1 -0
  4. data/History.txt +90 -0
  5. data/active-fedora.gemspec +2 -2
  6. data/lib/active_fedora.rb +17 -3
  7. data/lib/active_fedora/associations.rb +77 -0
  8. data/lib/active_fedora/associations/association.rb +2 -2
  9. data/lib/active_fedora/associations/basic_contains_association.rb +52 -0
  10. data/lib/active_fedora/associations/builder/directly_contains.rb +23 -0
  11. data/lib/active_fedora/associations/builder/directly_contains_one.rb +44 -0
  12. data/lib/active_fedora/associations/builder/has_and_belongs_to_many.rb +2 -23
  13. data/lib/active_fedora/associations/builder/indirectly_contains.rb +26 -0
  14. data/lib/active_fedora/associations/builder/property.rb +10 -0
  15. data/lib/active_fedora/associations/collection_association.rb +42 -45
  16. data/lib/active_fedora/associations/collection_proxy.rb +6 -0
  17. data/lib/active_fedora/associations/contained_finder.rb +41 -0
  18. data/lib/active_fedora/associations/container_proxy.rb +9 -0
  19. data/lib/active_fedora/associations/contains_association.rb +20 -38
  20. data/lib/active_fedora/associations/delete_proxy.rb +28 -0
  21. data/lib/active_fedora/associations/directly_contains_association.rb +56 -0
  22. data/lib/active_fedora/associations/directly_contains_one_association.rb +113 -0
  23. data/lib/active_fedora/associations/has_and_belongs_to_many_association.rb +6 -14
  24. data/lib/active_fedora/associations/has_many_association.rb +0 -3
  25. data/lib/active_fedora/associations/id_composite.rb +30 -0
  26. data/lib/active_fedora/associations/indirectly_contains_association.rb +90 -0
  27. data/lib/active_fedora/associations/rdf.rb +8 -4
  28. data/lib/active_fedora/associations/record_composite.rb +39 -0
  29. data/lib/active_fedora/attached_files.rb +1 -1
  30. data/lib/active_fedora/attributes.rb +28 -10
  31. data/lib/active_fedora/attributes/active_triple_attribute.rb +17 -0
  32. data/lib/active_fedora/attributes/om_attribute.rb +29 -0
  33. data/lib/active_fedora/attributes/rdf_datastream_attribute.rb +47 -0
  34. data/lib/active_fedora/attributes/stream_attribute.rb +46 -0
  35. data/lib/active_fedora/autosave_association.rb +2 -2
  36. data/lib/active_fedora/base.rb +3 -0
  37. data/lib/active_fedora/containers/container.rb +38 -0
  38. data/lib/active_fedora/containers/direct_container.rb +5 -0
  39. data/lib/active_fedora/containers/indirect_container.rb +7 -0
  40. data/lib/active_fedora/core.rb +4 -48
  41. data/lib/active_fedora/delegated_attribute.rb +5 -98
  42. data/lib/active_fedora/fedora.rb +1 -1
  43. data/lib/active_fedora/fedora_attributes.rb +4 -26
  44. data/lib/active_fedora/file.rb +87 -159
  45. data/lib/active_fedora/file/attributes.rb +63 -0
  46. data/lib/active_fedora/file/streaming.rb +46 -0
  47. data/lib/active_fedora/file_relation.rb +7 -0
  48. data/lib/active_fedora/identifiable.rb +87 -0
  49. data/lib/active_fedora/inbound_relation_connection.rb +21 -0
  50. data/lib/active_fedora/indexers.rb +10 -0
  51. data/lib/active_fedora/indexers/global_indexer.rb +30 -0
  52. data/lib/active_fedora/indexers/null_indexer.rb +12 -0
  53. data/lib/active_fedora/indexing/map.rb +4 -5
  54. data/lib/active_fedora/indexing_service.rb +3 -22
  55. data/lib/active_fedora/loadable_from_json.rb +8 -0
  56. data/lib/active_fedora/pathing.rb +24 -0
  57. data/lib/active_fedora/persistence.rb +15 -8
  58. data/lib/active_fedora/rdf.rb +2 -0
  59. data/lib/active_fedora/rdf/fcrepo4.rb +1 -0
  60. data/lib/active_fedora/rdf/field_map.rb +90 -0
  61. data/lib/active_fedora/rdf/field_map_entry.rb +28 -0
  62. data/lib/active_fedora/rdf/indexing_service.rb +9 -23
  63. data/lib/active_fedora/rdf/rdf_datastream.rb +1 -2
  64. data/lib/active_fedora/reflection.rb +16 -15
  65. data/lib/active_fedora/relation/delegation.rb +15 -4
  66. data/lib/active_fedora/relation/finder_methods.rb +4 -4
  67. data/lib/active_fedora/schema.rb +26 -0
  68. data/lib/active_fedora/schema_indexing_strategy.rb +25 -0
  69. data/lib/active_fedora/simple_datastream.rb +2 -2
  70. data/lib/active_fedora/solr_query_builder.rb +3 -2
  71. data/lib/active_fedora/version.rb +1 -1
  72. data/lib/active_fedora/with_metadata.rb +1 -1
  73. data/spec/integration/associations/rdf_spec.rb +49 -0
  74. data/spec/integration/base_spec.rb +19 -0
  75. data/spec/integration/belongs_to_association_spec.rb +6 -6
  76. data/spec/integration/collection_association_spec.rb +4 -4
  77. data/spec/integration/complex_rdf_datastream_spec.rb +12 -12
  78. data/spec/integration/datastream_rdf_nested_attributes_spec.rb +1 -1
  79. data/spec/integration/direct_container_spec.rb +254 -0
  80. data/spec/integration/directly_contains_one_association_spec.rb +102 -0
  81. data/spec/integration/file_spec.rb +16 -5
  82. data/spec/integration/has_many_associations_spec.rb +93 -58
  83. data/spec/integration/indirect_container_spec.rb +251 -0
  84. data/spec/integration/rdf_nested_attributes_spec.rb +1 -1
  85. data/spec/integration/relation_spec.rb +43 -27
  86. data/spec/spec_helper.rb +1 -1
  87. data/spec/unit/attributes_spec.rb +6 -6
  88. data/spec/unit/collection_proxy_spec.rb +28 -0
  89. data/spec/unit/file_spec.rb +1 -1
  90. data/spec/unit/files_hash_spec.rb +4 -4
  91. data/spec/unit/has_and_belongs_to_many_association_spec.rb +11 -9
  92. data/spec/unit/indexers/global_indexer_spec.rb +41 -0
  93. data/spec/unit/indexing_service_spec.rb +0 -21
  94. data/spec/unit/loadable_from_json_spec.rb +31 -0
  95. data/spec/unit/pathing_spec.rb +37 -0
  96. data/spec/unit/rdf/indexing_service_spec.rb +3 -3
  97. data/spec/unit/rdf_resource_datastream_spec.rb +26 -7
  98. data/spec/unit/schema_indexing_strategy_spec.rb +68 -0
  99. data/spec/unit/solr_query_builder_spec.rb +1 -1
  100. data/spec/unit/solr_service_spec.rb +1 -1
  101. metadata +49 -8
@@ -0,0 +1,28 @@
1
+ module ActiveFedora::RDF
2
+ # Transient class that represents a field that we send to solr.
3
+ # It might be possible for two properties to share a single field map entry if they use the same solr key.
4
+ # @attribute [Symbol] type the data type hint for Solrizer
5
+ # @attribute [Array] behaviors the indexing hints such as :stored_searchable or :symbol
6
+ # @attribute [Array] values the actual values that get sent to solr
7
+ class FieldMapEntry
8
+
9
+ attr_accessor :type, :behaviors, :values
10
+
11
+ def initialize
12
+ @behaviors = []
13
+ @values = []
14
+ end
15
+
16
+ # Merges any existing values for solr fields with new, incoming values and ensures that resulting values are unique.
17
+ # @param [Symbol] type the data type for the field such as :string, :date, :integer
18
+ # @param [Array] behaviors Solrizer's behaviors for indexing such as :stored_searhable, :symbol
19
+ # @param [Array] values existing values for the solr field
20
+ def merge!(type, behaviors, values)
21
+ self.type ||= type
22
+ self.behaviors += behaviors
23
+ self.behaviors.uniq!
24
+ self.values += values
25
+ end
26
+
27
+ end
28
+ end
@@ -22,7 +22,7 @@ module ActiveFedora::RDF
22
22
  def add_assertions(prefix_method, solr_doc = {})
23
23
  fields.each do |field_key, field_info|
24
24
  solr_field_key = solr_document_field_name(field_key, prefix_method)
25
- Array(field_info[:values]).each do |val|
25
+ field_info.values.each do |val|
26
26
  append_to_solr_doc(solr_doc, solr_field_key, field_info, val)
27
27
  end
28
28
  end
@@ -38,7 +38,7 @@ module ActiveFedora::RDF
38
38
  def append_to_solr_doc(solr_doc, solr_field_key, field_info, val)
39
39
  self.class.create_and_insert_terms(solr_field_key,
40
40
  solr_document_field_value(val),
41
- field_info[:behaviors], solr_doc)
41
+ field_info.behaviors, solr_doc)
42
42
  end
43
43
 
44
44
  def solr_document_field_name(field_key, prefix_method)
@@ -54,7 +54,7 @@ module ActiveFedora::RDF
54
54
  when ::RDF::URI
55
55
  val.to_s
56
56
  when ActiveTriples::Resource
57
- val.solrize
57
+ val.node? ? val.rdf_label : val.rdf_subject.to_s
58
58
  else
59
59
  val
60
60
  end
@@ -64,35 +64,21 @@ module ActiveFedora::RDF
64
64
  object.resource
65
65
  end
66
66
 
67
- def properties
68
- object.class.properties
69
- end
70
-
71
67
  def index_config
72
68
  object.class.index_config
73
69
  end
74
70
 
75
- # returns a Hash, e.g.: {field => { values: [], type: :something, behaviors: [] }, ...}
71
+ # returns the field map instance
76
72
  def fields
77
- field_map = {}.with_indifferent_access
78
-
79
- index_config.each do |name, index_field_config|
80
- type = index_field_config.data_type
81
- behaviors = index_field_config.behaviors
82
- next unless type and behaviors
83
- next if kind_of_af_base?(name)
84
- field_map[name] = { values: find_values(name), type: type, behaviors: behaviors}
73
+ field_map_class.new do |field_map|
74
+ index_config.each { |name, index_field_config| field_map.insert(name, index_field_config, object) }
85
75
  end
86
- field_map
87
76
  end
88
77
 
89
- def kind_of_af_base?(name)
90
- config = properties[name.to_s]
91
- config && config[:class_name] && config[:class_name] < ActiveFedora::Base
78
+ # Override this method to use your own FieldMap class for custom indexing of objects and properties
79
+ def field_map_class
80
+ ActiveFedora::RDF::FieldMap
92
81
  end
93
82
 
94
- def find_values(name)
95
- object.send(name) || []
96
- end
97
83
  end
98
84
  end
@@ -23,8 +23,7 @@ module ActiveFedora
23
23
 
24
24
  def add_attribute_indexing_config(name, &block)
25
25
  Deprecation.warn(RDFDatastream, "Adding indexing to datastreams is deprecated")
26
- # TODO the hash can be initalized to return on of these
27
- index_config[name] ||= ActiveFedora::Indexing::Map::IndexObject.new &block
26
+ index_config[name] ||= ActiveFedora::Indexing::Map::IndexObject.new(name, &block)
28
27
  end
29
28
 
30
29
  # Trim the last segment off the URI to get the parents uri
@@ -10,7 +10,7 @@ module ActiveFedora
10
10
  module ClassMethods
11
11
  def create_reflection(macro, name, options, active_fedora)
12
12
  klass = case macro
13
- when :has_many, :belongs_to, :has_and_belongs_to_many, :contains
13
+ when :has_many, :belongs_to, :has_and_belongs_to_many, :contains, :directly_contains, :directly_contains_one, :indirectly_contains
14
14
  AssociationReflection
15
15
  when :rdf, :singular_rdf
16
16
  RDFPropertyReflection
@@ -106,11 +106,10 @@ module ActiveFedora
106
106
 
107
107
  # Returns a new, unsaved instance of the associated class. +options+ will
108
108
  # be passed to the class's constructor.
109
- def build_association(*options)
110
- klass.new(*options)
109
+ def build_association(*options, &block)
110
+ klass.new(*options, &block)
111
111
  end
112
112
 
113
-
114
113
  # Returns the class name for the macro.
115
114
  #
116
115
  # <tt>has_many :clients</tt> returns <tt>'Client'</tt>
@@ -167,14 +166,7 @@ module ActiveFedora
167
166
 
168
167
  def initialize(macro, name, options, active_fedora)
169
168
  super
170
- @collection = [:has_many, :has_and_belongs_to_many].include?(macro)
171
- end
172
-
173
-
174
- # Returns a new, unsaved instance of the associated class. +options+ will
175
- # be passed to the class's constructor.
176
- def build_association(*options)
177
- klass.new(*options)
169
+ @collection = [:has_many, :has_and_belongs_to_many, :directly_contains, :indirectly_contains].include?(macro)
178
170
  end
179
171
 
180
172
  # Creates a new instance of the associated class, and immediately saves it
@@ -193,10 +185,13 @@ module ActiveFedora
193
185
  options[:predicate]
194
186
  end
195
187
 
188
+ def predicate_for_solr
189
+ predicate.fragment || predicate.to_s.rpartition(/\//).last
190
+ end
191
+
196
192
  def solr_key
197
193
  @solr_key ||= begin
198
- predicate_string = predicate.fragment || predicate.to_s.rpartition(/\//).last
199
- ActiveFedora::SolrQueryBuilder.solr_name(predicate_string, :symbol)
194
+ ActiveFedora::SolrQueryBuilder.solr_name(predicate_for_solr, :symbol)
200
195
  end
201
196
  end
202
197
 
@@ -247,7 +242,7 @@ module ActiveFedora
247
242
  def association_class
248
243
  case macro
249
244
  when :contains
250
- Associations::ContainsAssociation
245
+ Associations::BasicContainsAssociation
251
246
  when :belongs_to
252
247
  Associations::BelongsToAssociation
253
248
  when :has_and_belongs_to_many
@@ -258,6 +253,12 @@ module ActiveFedora
258
253
  Associations::SingularRDF
259
254
  when :rdf
260
255
  Associations::RDF
256
+ when :directly_contains
257
+ Associations::DirectlyContainsAssociation
258
+ when :directly_contains_one
259
+ Associations::DirectlyContainsOneAssociation
260
+ when :indirectly_contains
261
+ Associations::IndirectlyContainsAssociation
261
262
  end
262
263
  end
263
264
 
@@ -6,14 +6,25 @@ module ActiveFedora
6
6
  # subsequent calls to that method faster by avoiding method_missing. The delegations
7
7
  # may vary depending on the klass of a relation, so we create a subclass of Relation
8
8
  # for each different klass, and the delegations are compiled into that subclass only.
9
-
9
+
10
+ BLACKLISTED_ARRAY_METHODS = [
11
+ :compact!, :flatten!, :reject!, :reverse!, :rotate!, :map!,
12
+ :shuffle!, :slice!, :sort!, :sort_by!, :delete_if,
13
+ :keep_if, :pop, :shift, :delete_at, :select!
14
+ ].to_set
15
+
10
16
  delegate :length, :collect, :map, :each, :all?, :include?, :to_ary, :to => :to_a
11
17
 
18
+ protected
19
+
20
+ def array_delegable?(method)
21
+ Array.method_defined?(method) && BLACKLISTED_ARRAY_METHODS.exclude?(method)
22
+ end
12
23
 
13
24
  def method_missing(method, *args, &block)
14
- if Array.method_defined?(method)
15
- self.class.delegate method, :to => :to_a
16
- to_a.send(method, *args, &block)
25
+ if array_delegable?(method)
26
+ self.class.delegate method, to: :to_a
27
+ to_a.public_send(method, *args, &block)
17
28
  else
18
29
  super
19
30
  end
@@ -28,7 +28,7 @@ module ActiveFedora
28
28
  end
29
29
  end
30
30
 
31
- # Returns an Array of objects of the Class that +find+ is being
31
+ # Returns an Array of objects of the Class that +find+ is being
32
32
  # called on
33
33
  #
34
34
  # @param[String,Hash] args either an id or a hash of conditions
@@ -40,12 +40,12 @@ module ActiveFedora
40
40
  options = options.dup
41
41
  cast = if @klass == ActiveFedora::Base && !options.has_key?(:cast)
42
42
  true
43
- else
43
+ else
44
44
  options.delete(:cast)
45
45
  end
46
46
  if options[:sort]
47
47
  # Deprecate sort sometime?
48
- sort = options.delete(:sort)
48
+ sort = options.delete(:sort)
49
49
  options[:order] ||= sort if sort.present?
50
50
  end
51
51
 
@@ -251,7 +251,7 @@ module ActiveFedora
251
251
  ids.map{|id| find_one(id, cast)}
252
252
  end
253
253
 
254
- private
254
+ private
255
255
 
256
256
  # Returns a solr query for the supplied conditions
257
257
  # @param[Hash] conditions solr conditions to match
@@ -0,0 +1,26 @@
1
+ module ActiveFedora
2
+ ##
3
+ # Implement the .apply_schema method from ActiveTriples to allow for
4
+ # externally defined schemas to be put on an AF::Base object.
5
+ module Schema
6
+ extend ActiveSupport::Concern
7
+
8
+ module ClassMethods
9
+ # Applies a schema to an ActiveFedora::Base.
10
+ # @note The default application strategy adds no indexing hints. You may
11
+ # want to implement a different strategy if you want to set values on the
12
+ # property reflection.
13
+ # @param schema [ActiveTriples::Schema] The schema to apply.
14
+ # @param strategy [#apply] The strategy to use for applying the schema.
15
+ # @example Apply a schema and index everything as symbol.
16
+ # apply_schema MySchema, ActiveFedora::SchemaIndexingStrategy.new(
17
+ # ActiveFedora::GlobalIndexer.new(:symbol)
18
+ # )
19
+ def apply_schema(schema, strategy=ActiveFedora::SchemaIndexingStrategy.new)
20
+ schema.properties.each do |property|
21
+ strategy.apply(self, property)
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,25 @@
1
+ module ActiveFedora
2
+ ##
3
+ # An extension strategy to also apply solr indexes for each property.
4
+ # @note If how a field is indexed changes based on property, this would be a
5
+ # good place to define that.
6
+ class SchemaIndexingStrategy
7
+ # @param [#index] indexer The indexer to use
8
+ def initialize(indexer=Indexers::NullIndexer.instance)
9
+ @indexer = indexer
10
+ end
11
+
12
+ # @param [ActiveFedora::Base] object The object to apply the property to.
13
+ # @param [ActiveTriples::Property, #name, #to_h] property The property to define.
14
+ def apply(object, property)
15
+ object.property property.name, property.to_h do |index|
16
+ indexer.new(property).index(index)
17
+ end
18
+ end
19
+
20
+ private
21
+
22
+ attr_reader :indexer
23
+ end
24
+ end
25
+
@@ -20,9 +20,9 @@ module ActiveFedora
20
20
 
21
21
  #Constructor. this class will call self.field for each DCTERM. In short, all DCTERMS fields will already exist
22
22
  #when this method returns. Each term is marked as a multivalue string.
23
- def initialize(digital_object=nil, dsid=nil, options={})
24
- super
23
+ def initialize(digital_object=nil, dsid=nil, options={}, &block)
25
24
  self.fields={}
25
+ super
26
26
  end
27
27
 
28
28
  # This method generates the various accessor and mutator methods on self for the datastream metadata attributes.
@@ -5,8 +5,9 @@ module ActiveFedora
5
5
  # If the id_array is empty, defaults to a query of "id:NEVER_USE_THIS_ID", which will return an empty solr response
6
6
  # @param [Array] id_array the ids that you want included in the query
7
7
  def self.construct_query_for_ids(id_array)
8
- q = id_array.reject { |x| x.blank? }.map { |id| raw_query(SOLR_DOCUMENT_ID, id) }
9
- q.empty? ? "id:NEVER_USE_THIS_ID" : q.join(" OR ".freeze)
8
+ ids = id_array.reject { |x| x.blank? }
9
+ return "id:NEVER_USE_THIS_ID" if ids.empty?
10
+ "{!terms f=#{SOLR_DOCUMENT_ID}}#{ids.join(',')}"
10
11
  end
11
12
 
12
13
  # Create a raw query clause suitable for sending to solr as an fq element
@@ -1,3 +1,3 @@
1
1
  module ActiveFedora
2
- VERSION = "9.1.2"
2
+ VERSION = "9.2.0.rc1"
3
3
  end
@@ -9,7 +9,7 @@ module ActiveFedora
9
9
  @metadata_node ||= self.class.metadata_schema.new(self)
10
10
  end
11
11
 
12
- def save(*)
12
+ def create_or_update(*)
13
13
  if super && !new_record?
14
14
  metadata_node.metadata_uri = described_by # TODO only necessary if the URI was < > before
15
15
  metadata_node.save # TODO if changed?
@@ -0,0 +1,49 @@
1
+ require 'spec_helper'
2
+
3
+ describe "rdf associations" do
4
+ context "when there is one relationship for the predicate" do
5
+ before do
6
+ class Foo < ActiveFedora::Base
7
+ end
8
+ class Library < ActiveFedora::Base
9
+ has_and_belongs_to_many :foos, predicate: ::RDF::URI('http://example.com')
10
+ end
11
+ end
12
+ after do
13
+ Object.send(:remove_const, :Foo)
14
+ Object.send(:remove_const, :Library)
15
+ end
16
+
17
+ let(:library) { Library.new }
18
+
19
+ it "doesn't not bother to filter by class type" do
20
+ expect(library.association(:foo_ids)).not_to receive(:filter_by_class)
21
+ library.foos.to_a
22
+ end
23
+ end
24
+
25
+ context "when two relationships have the same predicate" do
26
+ before do
27
+ class Foo < ActiveFedora::Base
28
+ end
29
+ class Bar < ActiveFedora::Base
30
+ end
31
+ class Library < ActiveFedora::Base
32
+ has_and_belongs_to_many :foos, predicate: ::RDF::URI('http://example.com')
33
+ has_and_belongs_to_many :bars, predicate: ::RDF::URI('http://example.com')
34
+ end
35
+ end
36
+ after do
37
+ Object.send(:remove_const, :Foo)
38
+ Object.send(:remove_const, :Bar)
39
+ Object.send(:remove_const, :Library)
40
+ end
41
+
42
+ let(:library) { Library.new }
43
+
44
+ it "filters by class type" do
45
+ expect(library.association(:foo_ids)).to receive(:filter_by_class).and_call_original
46
+ library.foos.to_a
47
+ end
48
+ end
49
+ end
@@ -135,6 +135,25 @@ describe ActiveFedora::Base do
135
135
  end
136
136
  end
137
137
 
138
+ describe "#apply_schema" do
139
+ before do
140
+ class ExampleSchema < ActiveTriples::Schema
141
+ property :title, predicate: RDF::DC.title
142
+ end
143
+ class ExampleBase < ActiveFedora::Base
144
+ apply_schema ExampleSchema, ActiveFedora::SchemaIndexingStrategy.new(ActiveFedora::Indexers::GlobalIndexer.new(:symbol))
145
+ end
146
+ end
147
+ after do
148
+ Object.send(:remove_const, :ExampleSchema)
149
+ Object.send(:remove_const, :ExampleBase)
150
+ end
151
+ let(:obj) { ExampleBase.new }
152
+ it "should configure properties and solrize them" do
153
+ obj.title = ["Test"]
154
+ expect(obj.to_solr[ActiveFedora::SolrQueryBuilder.solr_name("title", :symbol)]).to eq ["Test"]
155
+ end
156
+ end
138
157
 
139
158
  describe "#exists?" do
140
159
  let(:obj) { ActiveFedora::Base.create }
@@ -106,13 +106,13 @@ describe ActiveFedora::Base do
106
106
  end
107
107
 
108
108
  class SimpleCollection < ActiveFedora::Base
109
- has_many :objects, predicate: ActiveFedora::RDF::Fcrepo::RelsExt.isPartOf, class_name: 'SimpleObject', autosave: true
110
- has_many :complex_objects, predicate: ActiveFedora::RDF::Fcrepo::RelsExt.isPartOf, class_name: 'ZComplexObject', autosave: true
109
+ has_many :objects, predicate: ActiveFedora::RDF::Fcrepo::RelsExt.isPartOf, class_name: 'SimpleObject'
110
+ has_many :complex_objects, predicate: ActiveFedora::RDF::Fcrepo::RelsExt.isPartOf, class_name: 'ZComplexObject'
111
111
  end
112
112
 
113
113
  class ComplexCollection < SimpleCollection
114
- has_many :objects, predicate: ActiveFedora::RDF::Fcrepo::RelsExt.isPartOf, class_name: 'SimpleObject', autosave: true
115
- has_many :complex_objects, predicate: ActiveFedora::RDF::Fcrepo::RelsExt.isPartOf, class_name: 'ZComplexObject', autosave: true
114
+ has_many :objects, predicate: ActiveFedora::RDF::Fcrepo::RelsExt.isPartOf, class_name: 'SimpleObject'
115
+ has_many :complex_objects, predicate: ActiveFedora::RDF::Fcrepo::RelsExt.isPartOf, class_name: 'ZComplexObject'
116
116
 
117
117
  def assert_content_model
118
118
  self.has_model = [self.class.to_s, self.class.superclass.to_s]
@@ -172,7 +172,7 @@ describe ActiveFedora::Base do
172
172
  simple_collection.objects = [complex_object, simple_object]
173
173
  simple_collection.save!
174
174
  end
175
- it "ignores objects who's classes aren't specified" do
175
+ it "ignores objects whose classes aren't specified" do
176
176
  expect(simple_collection.complex_objects.size).to eq 1
177
177
  expect(simple_collection.complex_objects[0]).to be_instance_of ZComplexObject
178
178
  expect(simple_collection.complex_objects[1]).to be_nil
@@ -223,7 +223,7 @@ describe ActiveFedora::Base do
223
223
  end
224
224
 
225
225
  class SuperclassCollection < ActiveFedora::Base
226
- has_many :objects, predicate: ActiveFedora::RDF::Fcrepo::RelsExt.isPartOf, class_name: 'SuperclassObject', autosave: true
226
+ has_many :objects, predicate: ActiveFedora::RDF::Fcrepo::RelsExt.isPartOf, class_name: 'SuperclassObject'
227
227
  end
228
228
  end
229
229
  after :all do