Sha256: 419975a74bd00515b5a89d0de6288610da969d19f4cf352b2ca660a9699a62ec

Contents?: true

Size: 397 Bytes

Versions: 21

Compression:

Stored size: 397 Bytes

Contents

module Ddr::Batch
  class BatchDeletionJob
    @queue = :batch

    def self.perform(batch_id)
      batch = Batch.find(batch_id)
      batch.status = Batch::STATUS_DELETING
      batch.save!
      batch.destroy!
    end

    def self.before_enqueue_set_status(batch_id)
      batch = Batch.find(batch_id)
      batch.status = Batch::STATUS_QUEUED_FOR_DELETION
      batch.save
    end

  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
ddr-batch-1.7.2 app/jobs/ddr/batch/batch_deletion_job.rb
ddr-batch-1.7.1 app/jobs/ddr/batch/batch_deletion_job.rb
ddr-batch-1.7.0 app/jobs/ddr/batch/batch_deletion_job.rb
ddr-batch-1.6.1 app/jobs/ddr/batch/batch_deletion_job.rb
ddr-batch-1.6.0 app/jobs/ddr/batch/batch_deletion_job.rb
ddr-batch-1.6.0.rc1 app/jobs/ddr/batch/batch_deletion_job.rb
ddr-batch-1.5.1 app/jobs/ddr/batch/batch_deletion_job.rb
ddr-batch-1.5.0 app/jobs/ddr/batch/batch_deletion_job.rb
ddr-batch-1.5.0.rc1 app/jobs/ddr/batch/batch_deletion_job.rb
ddr-batch-1.4.1 app/jobs/ddr/batch/batch_deletion_job.rb
ddr-batch-1.4.0 app/jobs/ddr/batch/batch_deletion_job.rb
ddr-batch-1.4.0.rc1 app/jobs/ddr/batch/batch_deletion_job.rb
ddr-batch-1.3.0 app/jobs/ddr/batch/batch_deletion_job.rb
ddr-batch-1.3.0.rc1 app/jobs/ddr/batch/batch_deletion_job.rb
ddr-batch-1.2.0 app/jobs/ddr/batch/batch_deletion_job.rb
ddr-batch-1.2.0.rc6 app/jobs/ddr/batch/batch_deletion_job.rb
ddr-batch-1.2.0.rc5 app/jobs/ddr/batch/batch_deletion_job.rb
ddr-batch-1.2.0.rc4 app/jobs/ddr/batch/batch_deletion_job.rb
ddr-batch-1.2.0.rc3 app/jobs/ddr/batch/batch_deletion_job.rb
ddr-batch-1.2.0.rc2 app/jobs/ddr/batch/batch_deletion_job.rb