Sha256: 5393362818a5460337063c3982fe8576773d9cc37fd34c35a5568b82050edebf

Contents?: true

Size: 406 Bytes

Versions: 1

Compression:

Stored size: 406 Bytes

Contents

# frozen_string_literal: true

module Paperweight
  # Queues post processing.
  class PostProcessJob < ActiveJob::Base
    queue_as :default

    discard_on ActiveJob::DeserializationError

    def perform(model, name)
      processing = :"#{name}_processing"

      tempfile = Download.new.download(model.public_send(processing))
      model.update!(name => tempfile, processing => nil)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
paperweight-1.0.1 lib/paperweight/post_process_job.rb