Sha256: 890733e4d93b3953c5de2a5dcfad3cb0ddab6d707428f7fb063c5f8d70e90fd2

Contents?: true

Size: 643 Bytes

Versions: 24

Compression:

Stored size: 643 Bytes

Contents

# frozen_string_literal: true

module Bulkrax
  class DeleteWorkJob < ApplicationJob
    queue_as :import

    # rubocop:disable Rails/SkipsModelValidations
    def perform(entry, importer_run)
      work = entry.factory.find
      work&.delete
      ImporterRun.find(importer_run.id).increment!(:deleted_records)
      ImporterRun.find(importer_run.id).decrement!(:enqueued_records)
      entry.save!
      entry.importer.current_run = ImporterRun.find(importer_run.id)
      entry.importer.record_status
      entry.status_info("Deleted", ImporterRun.find(importer_run.id))
    end
    # rubocop:enable Rails/SkipsModelValidations
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
bulkrax-3.1.2 app/jobs/bulkrax/delete_work_job.rb
bulkrax-3.1.1 app/jobs/bulkrax/delete_work_job.rb
bulkrax-3.1.0 app/jobs/bulkrax/delete_work_job.rb
bulkrax-3.0.1 app/jobs/bulkrax/delete_work_job.rb
bulkrax-3.0.0 app/jobs/bulkrax/delete_work_job.rb
bulkrax-3.0.0.beta8 app/jobs/bulkrax/delete_work_job.rb
bulkrax-3.0.0.beta7 app/jobs/bulkrax/delete_work_job.rb
bulkrax-3.0.0.beta6 app/jobs/bulkrax/delete_work_job.rb
bulkrax-3.0.0.beta5 app/jobs/bulkrax/delete_work_job.rb
bulkrax-3.0.0.beta4 app/jobs/bulkrax/delete_work_job.rb
bulkrax-3.0.0.beta3 app/jobs/bulkrax/delete_work_job.rb
bulkrax-3.0.0.beta2 app/jobs/bulkrax/delete_work_job.rb
bulkrax-3.0.0.beta1 app/jobs/bulkrax/delete_work_job.rb
bulkrax-2.3.0 app/jobs/bulkrax/delete_work_job.rb
bulkrax-2.2.4 app/jobs/bulkrax/delete_work_job.rb
bulkrax-2.2.3 app/jobs/bulkrax/delete_work_job.rb
bulkrax-2.2.2 app/jobs/bulkrax/delete_work_job.rb
bulkrax-2.2.1 app/jobs/bulkrax/delete_work_job.rb
bulkrax-2.2.0 app/jobs/bulkrax/delete_work_job.rb
bulkrax-2.1.1 app/jobs/bulkrax/delete_work_job.rb