Class: Batch

Inherits:
ActiveFedora::Base show all
Includes:
Hydra::AccessControls::Permissions, 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, #to_param

Methods included from Sufia::ModelMethods

#apply_depositor_metadata, #to_s

Methods inherited from ActiveFedora::Base

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

Class Method Details

.find_or_create(pid) ⇒ Object



13
14
15
16
17
18
19
# File 'app/models/batch.rb', line 13

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

Instance Method Details

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



21
22
23
24
25
# File 'app/models/batch.rb', line 21

def to_solr(solr_doc={}, opts={})
  solr_doc = super(solr_doc, opts)
  solr_doc[Solrizer.solr_name('noid', Sufia::GenericFile.noid_indexer)] = noid
  return solr_doc
end