Class: ActiveStorage::CreateVariantsJob

Inherits:
BaseJob show all
Defined in:
activestorage/app/jobs/active_storage/create_variants_job.rb

Constant Summary

Constants included from ActiveSupport::Callbacks

ActiveSupport::Callbacks::CALLBACK_FILTER_TYPES

Instance Attribute Summary

Attributes included from ActiveJob::Core

#arguments, #enqueue_error, #enqueued_at, #exception_executions, #executions, #job_id, #locale, #priority, #provider_job_id, #queue_name, #scheduled_at, #serialized_arguments, #successfully_enqueued, #timezone

Instance Method Summary collapse

Methods included from ActiveJob::ExecutionState

#perform_now

Methods included from ActiveJob::Logging

#perform_now

Methods included from ActiveSupport::Concern

#append_features, #class_methods, extended, #included, #prepend_features, #prepended

Methods included from ActiveJob::Instrumentation

#instrument, #perform_now

Methods included from ActiveJob::Exceptions

#retry_job

Methods included from ActiveSupport::Callbacks

#run_callbacks

Methods included from ActiveJob::Execution

#perform_now

Methods included from ActiveSupport::Rescuable

#handler_for_rescue, #rescue_with_handler

Methods included from ActiveJob::Enqueuing

#enqueue

Methods included from ActiveJob::QueuePriority

#priority

Methods included from ActiveJob::QueueName

#queue_name

Methods included from ActiveJob::Core

#deserialize, #initialize, #serialize, #set, #successfully_enqueued?

Instance Method Details

#perform(blob, variants:, process:) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'activestorage/app/jobs/active_storage/create_variants_job.rb', line 9

def perform(blob, variants:, process:)
  @blob = blob
  @process = process

  create_preview_image if preview_image_needed?

  variants.each do |transformations|
    ActiveStorage::TransformJob.public_send(perform_method, @blob, transformations)
  end
end