Class: GeoblacklightAdmin::DeleteThumbnailJob

Inherits:
ApplicationJob
  • Object
show all
Defined in:
app/jobs/geoblacklight_admin/delete_thumbnail_job.rb

Instance Method Summary collapse

Instance Method Details

#perform(solr_document_id, bad_id = nil, queue = :priority) ⇒ Object



9
10
11
12
13
14
15
# File 'app/jobs/geoblacklight_admin/delete_thumbnail_job.rb', line 9

def perform(solr_document_id, bad_id = nil, queue = :priority)
  document = Document.find_by_friendlier_id(solr_document_id)
  if document.thumbnail.present?
    document.thumbnail.destroy!
  end
  BulkActionDocument.find(bad_id).state_machine.transition_to!(:success) if bad_id.present?
end