Class: Integral::Storage::ProcessImageVariantsJob

Inherits:
ApplicationJob
  • Object
show all
Defined in:
app/jobs/integral/storage/process_image_variants_job.rb

Instance Method Summary collapse

Instance Method Details

#perform(file) ⇒ Object



6
7
8
9
10
11
12
# File 'app/jobs/integral/storage/process_image_variants_job.rb', line 6

def perform(file)
  return if file.deleted? # Return early when files have already been soft-deleted

  Integral.image_sizes.values.each do |size|
    file.attachment.variant(Integral.image_transformation_options.merge!(resize_to_limit: size)).processed
  end
end