Class: ActiveStorage::PreviewImageJob
- Inherits:
-
BaseJob
- Object
- ActiveJob::Base
- BaseJob
- ActiveStorage::PreviewImageJob
- Defined in:
- activestorage/app/jobs/active_storage/preview_image_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
-
#initialize(*arguments) ⇒ PreviewImageJob
constructor
A new instance of PreviewImageJob.
- #perform(blob, variations) ⇒ Object
Methods included from ActiveJob::ExecutionState
Methods included from ActiveJob::Logging
Methods included from ActiveSupport::Concern
#append_features, #class_methods, extended, #included, #prepend_features, #prepended
Methods included from ActiveJob::Instrumentation
Methods included from ActiveJob::Exceptions
Methods included from ActiveSupport::Callbacks
Methods included from ActiveJob::Execution
Methods included from ActiveSupport::Rescuable
#handler_for_rescue, #rescue_with_handler
Methods included from ActiveJob::Enqueuing
Methods included from ActiveJob::QueuePriority
Methods included from ActiveJob::QueueName
Methods included from ActiveJob::Core
#deserialize, #serialize, #set, #successfully_enqueued?
Constructor Details
#initialize(*arguments) ⇒ PreviewImageJob
Returns a new instance of PreviewImageJob.
9 10 11 12 13 14 15 16 |
# File 'activestorage/app/jobs/active_storage/preview_image_job.rb', line 9 def initialize(*arguments) ActiveStorage.deprecator.warn(" ActiveStorage::PreviewImageJob is no longer used by Rails.\n It is deprecated and will be removed in Rails 9.0.\n Use the ActiveStorage::CreateVariantsJob instead.\n MSG\n super\nend\n".squish) |
Instance Method Details
#perform(blob, variations) ⇒ Object
18 19 20 21 22 23 24 |
# 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 |