Class: Batch

Inherits:
ActiveFedora::Base show all
Includes:
Hydra::ModelMixins::CommonMetadata, Hydra::ModelMixins::RightsMetadata, Sufia::ModelMethods, Sufia::Noid
Defined in:
app/models/batch.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Sufia::Noid

namespaceize, #noid, noidify, #normalize_identifier

Methods included from Sufia::ModelMethods

#apply_depositor_metadata

Methods inherited from ActiveFedora::Base

#create_event, #events, #log_event, stream, #stream

Class Method Details

.find_or_create(pid) ⇒ Object



33
34
35
36
37
38
39
# File 'app/models/batch.rb', line 33

def self.find_or_create(pid)
  begin
    @batch = Batch.find(pid)
  rescue ActiveFedora::ObjectNotFoundError
    @batch = Batch.create({pid: pid})
  end
end

Instance Method Details

#to_solr(solr_doc = {}, opts = {}) ⇒ Object



41
42
43
44
45
# File 'app/models/batch.rb', line 41

def to_solr(solr_doc={}, opts={})
  super(solr_doc, opts)
  solr_doc["noid_s"] = noid
  return solr_doc
end