Sha256: 509e1aea9839c6d4a637acea8038456e12e5e47731970879a769e244199559e4

Contents?: true

Size: 658 Bytes

Versions: 4

Compression:

Stored size: 658 Bytes

Contents

# frozen_string_literal: true

# BulkActionRevertJob
class BulkActionRevertJob < ApplicationJob
  queue_as :default

  def perform(bulk_action)
    action = case bulk_action.field_name
    when "Publication State"
      logger.debug("BulkAction: Revert Publication Status")
      :revert_publication_status
    when "Delete"
      logger.debug("BulkAction: Revert Delete")
      :revert_delete
    else
      logger.debug("BulkAction: Revert Field Value")
      :revert_field_value
    end

    bulk_action.documents.each do |doc|
      BulkActionRevertDocumentJob.perform_later(action, doc)
      doc.state_machine.transition_to!(:queued)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
geoblacklight_admin-0.3.0 app/jobs/bulk_action_revert_job.rb
geoblacklight_admin-0.2.1 app/jobs/bulk_action_revert_job.rb
geoblacklight_admin-0.1.0 app/jobs/bulk_action_revert_job.rb
geoblacklight_admin-0.0.1 app/jobs/bulk_action_revert_job.rb