Skip to Content Skip to Search
Methods
N
P

Class Public methods

new(*arguments)

# File activestorage/app/jobs/active_storage/preview_image_job.rb, line 9
  def initialize(*arguments)
    ActiveStorage.deprecator.warn(<<~MSG.squish)
      ActiveStorage::PreviewImageJob is no longer used by Rails.
      It is deprecated and will be removed in Rails 9.0.
      Use the ActiveStorage::CreateVariantsJob instead.
    MSG
    super
  end

Instance Public methods

perform(blob, variations)

# File activestorage/app/jobs/active_storage/preview_image_job.rb, line 18
def perform(blob, variations)
  blob.preview({}).processed

  variations.each do |transformations|
    ActiveStorage::TransformJob.perform_later(blob, transformations) if blob.representable?
  end
end