Sha256: 00c23d1a254fef7f5f28766882553040effc8bcb5f06fd9c3593d8a1bfa14637

Contents?: true

Size: 434 Bytes

Versions: 1

Compression:

Stored size: 434 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"
      image_url = model.public_send(processing)

      return unless image_url
      model.update!(name => Download.download(image_url), processing => nil)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

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