app/models/spotlight/resource.rb in blacklight-spotlight-0.19.2 vs app/models/spotlight/resource.rb in blacklight-spotlight-0.20.0
- old
+ new
@@ -1,10 +1,9 @@
module Spotlight
##
# Exhibit resources
class Resource < ActiveRecord::Base
- include Spotlight::SolrDocument::AtomicUpdates
include ActiveSupport::Benchmarkable
class_attribute :document_builder_class
self.document_builder_class = SolrDocumentBuilder
@@ -113,9 +112,13 @@
def commit
return unless write?
blacklight_solr.commit
rescue => e
Rails.logger.warn "Unable to commit to solr: #{e}"
+ end
+
+ def write?
+ Spotlight::Engine.config.writable_index
end
end
end
end