active-fedora 9.9.1 → 9.10.0.pre1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (106) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +4 -2
  3. data/.travis.yml +2 -6
  4. data/active-fedora.gemspec +9 -6
  5. data/lib/active_fedora.rb +31 -15
  6. data/lib/active_fedora/associations.rb +1 -1
  7. data/lib/active_fedora/associations/association.rb +6 -2
  8. data/lib/active_fedora/associations/belongs_to_association.rb +0 -10
  9. data/lib/active_fedora/associations/builder/association.rb +85 -12
  10. data/lib/active_fedora/associations/builder/belongs_to.rb +3 -1
  11. data/lib/active_fedora/associations/builder/collection_association.rb +4 -3
  12. data/lib/active_fedora/associations/builder/contains.rb +7 -2
  13. data/lib/active_fedora/associations/builder/directly_contains.rb +7 -3
  14. data/lib/active_fedora/associations/builder/directly_contains_one.rb +8 -4
  15. data/lib/active_fedora/associations/builder/has_and_belongs_to_many.rb +6 -2
  16. data/lib/active_fedora/associations/builder/has_many.rb +6 -2
  17. data/lib/active_fedora/associations/builder/indirectly_contains.rb +7 -3
  18. data/lib/active_fedora/associations/builder/property.rb +7 -2
  19. data/lib/active_fedora/associations/builder/singular_association.rb +3 -1
  20. data/lib/active_fedora/associations/builder/singular_property.rb +3 -1
  21. data/lib/active_fedora/associations/collection_association.rb +9 -5
  22. data/lib/active_fedora/associations/collection_proxy.rb +1 -1
  23. data/lib/active_fedora/associations/contained_finder.rb +1 -2
  24. data/lib/active_fedora/associations/directly_contains_one_association.rb +1 -1
  25. data/lib/active_fedora/associations/has_many_association.rb +1 -5
  26. data/lib/active_fedora/associations/rdf.rb +1 -20
  27. data/lib/active_fedora/attached_files.rb +1 -1
  28. data/lib/active_fedora/attribute_methods.rb +18 -0
  29. data/lib/active_fedora/attributes.rb +1 -1
  30. data/lib/active_fedora/autosave_association.rb +8 -12
  31. data/lib/active_fedora/base.rb +0 -2
  32. data/lib/active_fedora/caching_connection.rb +1 -1
  33. data/lib/active_fedora/default_model_mapper.rb +24 -0
  34. data/lib/active_fedora/fedora.rb +1 -1
  35. data/lib/active_fedora/file/attributes.rb +4 -5
  36. data/lib/active_fedora/identifiable.rb +5 -0
  37. data/lib/active_fedora/indexing.rb +13 -7
  38. data/lib/active_fedora/indexing_service.rb +4 -4
  39. data/lib/active_fedora/ldp_resource.rb +1 -0
  40. data/lib/active_fedora/model.rb +18 -16
  41. data/lib/active_fedora/model_classifier.rb +77 -0
  42. data/lib/active_fedora/nested_attributes.rb +145 -18
  43. data/lib/active_fedora/persistence.rb +1 -1
  44. data/lib/active_fedora/predicates.rb +3 -0
  45. data/lib/active_fedora/qualified_dublin_core_datastream.rb +1 -1
  46. data/lib/active_fedora/query_result_builder.rb +12 -28
  47. data/lib/active_fedora/querying.rb +1 -1
  48. data/lib/active_fedora/rdf/datastream_indexing.rb +1 -1
  49. data/lib/active_fedora/reflection.rb +15 -7
  50. data/lib/active_fedora/relation.rb +17 -0
  51. data/lib/active_fedora/relation/calculations.rb +1 -5
  52. data/lib/active_fedora/relation/finder_methods.rb +39 -26
  53. data/lib/active_fedora/scoping.rb +5 -0
  54. data/lib/active_fedora/scoping/default.rb +113 -0
  55. data/lib/active_fedora/scoping/named.rb +11 -3
  56. data/lib/active_fedora/simple_datastream.rb +1 -1
  57. data/lib/active_fedora/solr_hit.rb +71 -0
  58. data/lib/active_fedora/solr_instance_loader.rb +12 -36
  59. data/lib/active_fedora/solr_query_builder.rb +20 -25
  60. data/lib/active_fedora/solr_service.rb +24 -13
  61. data/lib/active_fedora/type.rb +8 -0
  62. data/lib/active_fedora/type/boolean.rb +23 -0
  63. data/lib/active_fedora/type/value.rb +118 -0
  64. data/lib/active_fedora/validations.rb +14 -5
  65. data/lib/active_fedora/version.rb +1 -1
  66. data/lib/active_fedora/versionable.rb +8 -7
  67. data/spec/config_helper.rb +0 -5
  68. data/spec/integration/associations_spec.rb +5 -5
  69. data/spec/integration/base_spec.rb +4 -4
  70. data/spec/integration/bug_spec.rb +0 -1
  71. data/spec/integration/full_featured_model_spec.rb +4 -4
  72. data/spec/integration/has_and_belongs_to_many_associations_spec.rb +1 -1
  73. data/spec/integration/has_many_associations_spec.rb +30 -1
  74. data/spec/integration/indirect_container_spec.rb +1 -1
  75. data/spec/integration/nested_attribute_spec.rb +6 -0
  76. data/spec/integration/ntriples_datastream_spec.rb +4 -4
  77. data/spec/integration/om_datastream_spec.rb +1 -1
  78. data/spec/integration/relation_delegation_spec.rb +1 -1
  79. data/spec/integration/scoped_query_spec.rb +12 -12
  80. data/spec/integration/solr_hit_spec.rb +52 -0
  81. data/spec/samples/hydra-mods_article_datastream.rb +2 -2
  82. data/spec/spec_helper.rb +5 -9
  83. data/spec/unit/active_fedora_spec.rb +0 -26
  84. data/spec/unit/base_spec.rb +20 -0
  85. data/spec/unit/builder/has_and_belongs_to_many_spec.rb +2 -3
  86. data/spec/unit/callback_spec.rb +3 -8
  87. data/spec/unit/default_model_mapper_spec.rb +39 -0
  88. data/spec/unit/finder_methods_spec.rb +30 -6
  89. data/spec/unit/has_many_association_spec.rb +23 -1
  90. data/spec/unit/indexing_spec.rb +17 -3
  91. data/spec/unit/model_classifier_spec.rb +49 -0
  92. data/spec/unit/model_spec.rb +0 -9
  93. data/spec/unit/ntriples_datastream_spec.rb +16 -16
  94. data/spec/unit/om_datastream_spec.rb +7 -7
  95. data/spec/unit/qualified_dublin_core_datastream_spec.rb +1 -1
  96. data/spec/unit/query_result_builder_spec.rb +4 -10
  97. data/spec/unit/query_spec.rb +28 -28
  98. data/spec/unit/rdf/indexing_service_spec.rb +16 -16
  99. data/spec/unit/scoping_spec.rb +67 -0
  100. data/spec/unit/simple_datastream_spec.rb +2 -2
  101. data/spec/unit/solr_config_options_spec.rb +29 -32
  102. data/spec/unit/solr_hit_spec.rb +58 -0
  103. data/spec/unit/solr_query_builder_spec.rb +9 -1
  104. data/spec/unit/solr_service_spec.rb +19 -3
  105. metadata +73 -17
  106. data/spec/support/freeze_mocks.rb +0 -12
@@ -1,8 +1,12 @@
1
1
  module ActiveFedora::Associations::Builder
2
2
  class DirectlyContainsOne < SingularAssociation #:nodoc:
3
- self.macro = :directly_contains_one
4
- self.valid_options += [:has_member_relation, :is_member_of_relation, :type, :through]
5
- self.valid_options -= [:predicate]
3
+ def self.macro
4
+ :directly_contains_one
5
+ end
6
+
7
+ def self.valid_options(options)
8
+ super + [:has_member_relation, :is_member_of_relation, :type, :through] - [:predicate]
9
+ end
6
10
 
7
11
  def validate_options
8
12
  raise ArgumentError, "you must specify a :through option on #{name}. #{name} will use the container from that directly_contains association." unless options[:through]
@@ -34,7 +38,7 @@ module ActiveFedora::Associations::Builder
34
38
  end
35
39
 
36
40
  def lookup_reflection(association_name)
37
- model.reflect_on_association(association_name)
41
+ model._reflect_on_association(association_name)
38
42
  end
39
43
  end
40
44
  end
@@ -1,9 +1,13 @@
1
1
  module ActiveFedora::Associations::Builder
2
2
  class HasAndBelongsToMany < CollectionAssociation #:nodoc:
3
3
  extend Deprecation
4
- self.macro = :has_and_belongs_to_many
4
+ def self.macro
5
+ :has_and_belongs_to_many
6
+ end
5
7
 
6
- self.valid_options += [:inverse_of, :solr_page_size]
8
+ def self.valid_options(options)
9
+ super + [:inverse_of, :solr_page_size]
10
+ end
7
11
 
8
12
  def validate_options
9
13
  super
@@ -1,8 +1,12 @@
1
1
  module ActiveFedora::Associations::Builder
2
2
  class HasMany < CollectionAssociation #:nodoc:
3
- self.macro = :has_many
3
+ def self.macro
4
+ :has_many
5
+ end
4
6
 
5
- self.valid_options += [:as, :dependent, :inverse_of]
7
+ def self.valid_options(options)
8
+ super + [:as, :dependent, :inverse_of]
9
+ end
6
10
 
7
11
  def build
8
12
  reflection = super
@@ -1,8 +1,12 @@
1
1
  module ActiveFedora::Associations::Builder
2
2
  class IndirectlyContains < CollectionAssociation #:nodoc:
3
- self.macro = :indirectly_contains
4
- self.valid_options += [:has_member_relation, :is_member_of_relation, :inserted_content_relation, :foreign_key, :through]
5
- self.valid_options -= [:predicate]
3
+ def self.macro
4
+ :indirectly_contains
5
+ end
6
+
7
+ def self.valid_options(options)
8
+ super + [:has_member_relation, :is_member_of_relation, :inserted_content_relation, :foreign_key, :through] - [:predicate]
9
+ end
6
10
 
7
11
  def build
8
12
  reflection = super
@@ -1,7 +1,12 @@
1
1
  module ActiveFedora::Associations::Builder
2
2
  class Property < Association
3
- self.macro = :rdf
4
- self.valid_options = [:class_name, :predicate, :type_validator]
3
+ def self.macro
4
+ :rdf
5
+ end
6
+
7
+ def self.valid_options(options)
8
+ super
9
+ end
5
10
 
6
11
  def initialize(model, name, options)
7
12
  super
@@ -1,6 +1,8 @@
1
1
  module ActiveFedora::Associations::Builder
2
2
  class SingularAssociation < Association #:nodoc:
3
- self.valid_options += [:dependent, :inverse_of]
3
+ def self.valid_options(options)
4
+ super + [:dependent, :inverse_of]
5
+ end
4
6
 
5
7
  def self.constructable?
6
8
  true
@@ -1,6 +1,8 @@
1
1
  module ActiveFedora::Associations::Builder
2
2
  class SingularProperty < Property
3
- self.macro = :singular_rdf
3
+ def self.macro
4
+ :singular_rdf
5
+ end
4
6
 
5
7
  def initialize(model, name, options)
6
8
  super
@@ -14,7 +14,13 @@ module ActiveFedora
14
14
  force_reload = opts
15
15
  end
16
16
  reload if force_reload || stale_target?
17
- @proxy ||= CollectionProxy.new(self)
17
+ if null_scope?
18
+ # Cache the proxy separately before the owner has an id
19
+ # or else a post-save proxy will still lack the id
20
+ @null_proxy ||= CollectionProxy.new(self)
21
+ else
22
+ @proxy ||= CollectionProxy.new(self)
23
+ end
18
24
  end
19
25
 
20
26
  # Implements the writer method, e.g. foo.items= for Foo.has_many :items
@@ -27,9 +33,7 @@ module ActiveFedora
27
33
  if loaded?
28
34
  load_target.map(&:id)
29
35
  else
30
- load_from_solr.map do |solr_record|
31
- solr_record['id']
32
- end
36
+ load_from_solr.map(&:id)
33
37
  end
34
38
  end
35
39
 
@@ -225,7 +229,7 @@ module ActiveFedora
225
229
  # Count all records using solr. Construct options and pass them with
226
230
  # scope to the target class's +count+.
227
231
  def count(_options = {})
228
- @reflection.klass.count(conditions: construct_query)
232
+ scope.count
229
233
  end
230
234
 
231
235
  # Sets the target of this proxy to <tt>\target</tt>, and the \loaded flag to +true+.
@@ -38,7 +38,7 @@ module ActiveFedora
38
38
  def initialize(association)
39
39
  @association = association
40
40
  super association.klass
41
- merge! association.scope
41
+ merge! association.scope(nullify: false)
42
42
  end
43
43
 
44
44
  def target
@@ -42,8 +42,7 @@ module ActiveFedora::Associations
42
42
  query = ActiveFedora::SolrQueryBuilder.construct_query_for_rel(
43
43
  [[:has_model, proxy_class.to_class_uri], [:proxyFor, record.id]]
44
44
  )
45
- results = ActiveFedora::SolrService.query(query, fl: 'id')
46
- results.map { |res| ::RDF::URI(ActiveFedora::Base.id_to_uri(res['id'])) }
45
+ ActiveFedora::SolrService.query(query, fl: 'id').map(&:rdf_uri)
47
46
  end
48
47
  end
49
48
  end
@@ -66,7 +66,7 @@ module ActiveFedora
66
66
 
67
67
  # Returns the Reflection corresponding to the direct container association that's being filtered
68
68
  def container_reflection
69
- @container_reflection ||= @owner.class.reflect_on_association(@reflection.options[:through])
69
+ @container_reflection ||= @owner.class._reflect_on_association(@reflection.options[:through])
70
70
  end
71
71
 
72
72
  # Returns the DirectContainerAssociation corresponding to the direct container that's being filtered
@@ -14,11 +14,7 @@ module ActiveFedora
14
14
  # If the collection is empty the target is set to an empty array and
15
15
  # the loaded flag is set to true as well.
16
16
  def count_records
17
- count = if loaded?
18
- @target.size
19
- else
20
- @reflection.klass.count(conditions: construct_query)
21
- end
17
+ count = scope.count
22
18
 
23
19
  # If there's nothing in the database and @target has no new records
24
20
  # we are certain the current target is an empty array. This is a
@@ -60,26 +60,7 @@ module ActiveFedora
60
60
  ids = candidate_uris.map { |uri| ActiveFedora::Base.uri_to_id(uri) }
61
61
  results = ActiveFedora::SolrService.query(ActiveFedora::SolrQueryBuilder.construct_query_for_ids(ids), rows: 10_000)
62
62
 
63
- docs = results.select do |result|
64
- ActiveFedora::QueryResultBuilder.classes_from_solr_document(result).any? do |klass|
65
- class_ancestors(klass).include? reflection.klass
66
- end
67
- end
68
-
69
- docs.map { |doc| ::RDF::URI.new(ActiveFedora::Base.id_to_uri(doc['id'])) }
70
- end
71
-
72
- ##
73
- # Returns a list of all the ancestor classes up to ActiveFedora::Base including the class itself
74
- # @param [Class] klass
75
- # @return [Array<Class>]
76
- # @example
77
- # class Car < ActiveFedora::Base; end
78
- # class SuperCar < Car; end
79
- # class_ancestors(SuperCar)
80
- # # => [SuperCar, Car, ActiveFedora::Base]
81
- def class_ancestors(klass)
82
- klass.ancestors.select { |k| k.instance_of?(Class) } - [Object, BasicObject]
63
+ results.select { |result| result.model? reflection.klass }.map(&:rdf_uri)
83
64
  end
84
65
  end
85
66
  end
@@ -49,7 +49,7 @@ module ActiveFedora
49
49
  deprecation_deprecate :clear_datastreams
50
50
 
51
51
  def contains_assertions
52
- resource.query(subject: resource, predicate: Ldp.contains).objects.map(&:to_s)
52
+ resource.query(subject: resource, predicate: ::RDF::Vocab::LDP.contains).objects.map(&:to_s)
53
53
  end
54
54
 
55
55
  def load_attached_files
@@ -110,6 +110,24 @@ module ActiveFedora
110
110
  include @generated_attribute_methods
111
111
  end
112
112
 
113
+ # A method name is 'dangerous' if it is already (re)defined by Active Fedora, but
114
+ # not by any ancestors. (So 'puts' is not dangerous but 'save' is.)
115
+ def dangerous_attribute_method?(name) # :nodoc:
116
+ method_defined_within?(name, Base)
117
+ end
118
+
119
+ def method_defined_within?(name, klass, superklass = klass.superclass) # :nodoc:
120
+ if klass.method_defined?(name) || klass.private_method_defined?(name)
121
+ if superklass.method_defined?(name) || superklass.private_method_defined?(name)
122
+ klass.instance_method(name).owner != superklass.instance_method(name).owner
123
+ else
124
+ true
125
+ end
126
+ else
127
+ false
128
+ end
129
+ end
130
+
113
131
  private
114
132
 
115
133
  # @param name [Symbol] name of the attribute to generate
@@ -239,7 +239,7 @@ module ActiveFedora
239
239
  # @param [String] dsid the datastream id
240
240
  # @return [Class] the class of the datastream
241
241
  def datastream_class_for_name(dsid)
242
- reflection = reflect_on_association(dsid.to_sym)
242
+ reflection = _reflect_on_association(dsid.to_sym)
243
243
  reflection ? reflection.klass : ActiveFedora::File
244
244
  end
245
245
 
@@ -75,24 +75,20 @@ module ActiveFedora
75
75
  module AutosaveAssociation
76
76
  extend ActiveSupport::Concern
77
77
 
78
- ASSOCIATION_TYPES = %w( HasMany BelongsTo HasAndBelongsToMany DirectlyContains IndirectlyContains).freeze
78
+ ASSOCIATION_TYPES = [:has_many, :belongs_to, :has_and_belongs_to_many, :directly_contains, :indirectly_contains].freeze
79
79
 
80
80
  module AssociationBuilderExtension #:nodoc:
81
- def self.included(base)
82
- base.valid_options << :autosave
81
+ def self.valid_options
82
+ [:autosave]
83
83
  end
84
84
 
85
- def build
86
- reflection = super
87
- model.send(:add_autosave_association_callbacks, reflection)
88
- reflection
85
+ def self.build(model, reflection)
86
+ model.send(:define_autosave_association_callbacks, reflection) if ASSOCIATION_TYPES.include? reflection.macro
89
87
  end
90
88
  end
91
89
 
92
90
  included do
93
- ASSOCIATION_TYPES.each do |type|
94
- Associations::Builder.const_get(type).send(:include, AssociationBuilderExtension)
95
- end
91
+ Associations::Builder::Association.extensions << AssociationBuilderExtension
96
92
  end
97
93
 
98
94
  module ClassMethods
@@ -127,7 +123,7 @@ module ActiveFedora
127
123
  # the callbacks to get defined multiple times, there are guards that
128
124
  # check if the save or validation methods have already been defined
129
125
  # before actually defining them.
130
- def add_autosave_association_callbacks(reflection)
126
+ def define_autosave_association_callbacks(reflection)
131
127
  save_method = :"autosave_associated_records_for_#{reflection.name}"
132
128
  validation_method = :"validate_associated_records_for_#{reflection.name}"
133
129
  collection = reflection.collection?
@@ -287,7 +283,7 @@ module ActiveFedora
287
283
  end
288
284
 
289
285
  # reconstruct the scope now that we know the owner's id
290
- association.send(:construct_scope) if association.respond_to?(:construct_scope)
286
+ association.send(:reset_scope) if association.respond_to?(:reset_scope)
291
287
  end
292
288
  end
293
289
 
@@ -1,5 +1,3 @@
1
- SOLR_DOCUMENT_ID = "id".freeze unless defined?(SOLR_DOCUMENT_ID) && !SOLR_DOCUMENT_ID.nil?
2
- ENABLE_SOLR_UPDATES = true unless defined?(ENABLE_SOLR_UPDATES)
3
1
  require 'active_support/descendants_tracker'
4
2
  require 'active_fedora/errors'
5
3
  require 'active_fedora/log_subscriber'
@@ -1,6 +1,6 @@
1
1
  module ActiveFedora
2
2
  class CachingConnection < Ldp::Client
3
- def initialize(host)
3
+ def initialize(host, options = {})
4
4
  super
5
5
  @cache = {}
6
6
  @cache_enabled = false
@@ -0,0 +1,24 @@
1
+ module ActiveFedora
2
+ # Create model classifiers for resources or solr documents
3
+ class DefaultModelMapper
4
+ attr_reader :classifier_class, :solr_field, :predicate
5
+
6
+ def initialize(classifier_class: ActiveFedora::ModelClassifier, solr_field: ActiveFedora::QueryResultBuilder::HAS_MODEL_SOLR_FIELD, predicate: ActiveFedora::RDF::Fcrepo::Model.hasModel)
7
+ @classifier_class = classifier_class
8
+ @solr_field = solr_field
9
+ @predicate = predicate
10
+ end
11
+
12
+ def classifier(resource)
13
+ models = if resource.respond_to? :graph
14
+ resource.graph.query([nil, predicate, nil]).map { |rg| rg.object.to_s }
15
+ elsif resource.respond_to? :[]
16
+ resource[solr_field] || []
17
+ else
18
+ []
19
+ end
20
+
21
+ classifier_class.new(models)
22
+ end
23
+ end
24
+ end
@@ -30,7 +30,7 @@ module ActiveFedora
30
30
  # things like ldp:IndirectContainers, but it's imposes a significant
31
31
  # performance penalty on every request
32
32
  # @connection ||= InboundRelationConnection.new(CachingConnection.new(authorized_connection))
33
- @connection ||= CachingConnection.new(authorized_connection)
33
+ @connection ||= CachingConnection.new(authorized_connection, omit_ldpr_interaction_model: true)
34
34
  end
35
35
 
36
36
  def clean_connection
@@ -21,7 +21,7 @@ module ActiveFedora::File::Attributes
21
21
  end
22
22
 
23
23
  def persisted_size
24
- ldp_source.head.headers['Content-Length'].to_i unless new_record?
24
+ ldp_source.head.content_length unless new_record?
25
25
  end
26
26
 
27
27
  def dirty_size
@@ -60,7 +60,7 @@ module ActiveFedora::File::Attributes
60
60
  end
61
61
 
62
62
  def links
63
- @links ||= Ldp::Response.links(ldp_source.head)
63
+ @links ||= ldp_source.head.links
64
64
  end
65
65
 
66
66
  def default_mime_type
@@ -69,12 +69,11 @@ module ActiveFedora::File::Attributes
69
69
 
70
70
  def fetch_mime_type
71
71
  return default_mime_type if new_record?
72
- ldp_source.head.headers['Content-Type']
72
+ ldp_source.head.content_type
73
73
  end
74
74
 
75
75
  def fetch_original_name
76
76
  return if new_record?
77
- m = ldp_source.head.headers['Content-Disposition'].match(/filename="(?<filename>[^"]*)";/)
78
- URI.decode(m[:filename])
77
+ ldp_source.head.content_disposition_filename
79
78
  end
80
79
  end
@@ -78,6 +78,11 @@ module ActiveFedora
78
78
  rescue ActiveFedora::ObjectNotFoundError, Ldp::Gone
79
79
  ActiveTriples::Resource.new(uri)
80
80
  end
81
+
82
+ # Abstract classes can't have default scopes.
83
+ def abstract_class?
84
+ self == Base
85
+ end
81
86
  end
82
87
  end
83
88
  end
@@ -15,6 +15,16 @@ module ActiveFedora
15
15
  autoload :Map
16
16
  end
17
17
 
18
+ included do
19
+ # Because the previous method of setting indexer was to override
20
+ # the class method, we must ensure that we aren't using the instance
21
+ # reader so that the old method still works.
22
+ class_attribute :indexer, instance_accessor: false
23
+
24
+ # This is the default indexer class to use for this model.
25
+ self.indexer = IndexingService
26
+ end
27
+
18
28
  # Return a Hash representation of this object where keys in the hash are appropriate Solr field names.
19
29
  # @param [Hash] _solr_doc (optional) Hash to insert the fields into
20
30
  # @param [Hash] _opts (optional)
@@ -37,13 +47,13 @@ module ActiveFedora
37
47
  # Determines whether a create operation causes a solr index of this object by default.
38
48
  # Override this if you need different behavior.
39
49
  def create_needs_index?
40
- ENABLE_SOLR_UPDATES
50
+ ActiveFedora.enable_solr_updates?
41
51
  end
42
52
 
43
53
  # Determines whether an update operation causes a solr index of this object by default.
44
54
  # Override this if you need different behavior
45
55
  def update_needs_index?
46
- ENABLE_SOLR_UPDATES
56
+ ActiveFedora.enable_solr_updates?
47
57
  end
48
58
 
49
59
  private
@@ -72,10 +82,6 @@ module ActiveFedora
72
82
  end
73
83
  end
74
84
 
75
- def indexer
76
- IndexingService
77
- end
78
-
79
85
  def reindex_everything
80
86
  descendants = descendant_uris(ActiveFedora::Base.id_to_uri(''))
81
87
  descendants.shift # Discard the root uri
@@ -104,7 +110,7 @@ module ActiveFedora
104
110
  resource = Ldp::Resource::RdfSource.new(ActiveFedora.fedora.connection, uri)
105
111
  # GET could be slow if it's a big resource, we're using HEAD to avoid this problem,
106
112
  # but this causes more requests to Fedora.
107
- return [] unless Ldp::Response.rdf_source?(resource.head)
113
+ return [] unless resource.head.rdf_source?
108
114
  immediate_descendant_uris = resource.graph.query(predicate: ::RDF::Vocab::LDP.contains).map { |descendant| descendant.object.to_s }
109
115
  all_descendants_uris = [uri]
110
116
  immediate_descendant_uris.each do |descendant_uri|