Class: DelayedPaperclip::ProcessJob

Inherits:
ActiveJob::Base
  • Object
show all
Defined in:
lib/delayed_paperclip/process_job.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.enqueue_delayed_paperclip(instance_klass, instance_id, attachment_name) ⇒ Object



5
6
7
8
# File 'lib/delayed_paperclip/process_job.rb', line 5

def self.enqueue_delayed_paperclip(instance_klass, instance_id, attachment_name)
  queue_name = instance_klass.constantize.paperclip_definitions[attachment_name][:delayed][:queue]
  set(:queue => queue_name).perform_later(instance_klass, instance_id, attachment_name.to_s)
end

Instance Method Details

#perform(instance_klass, instance_id, attachment_name) ⇒ Object



10
11
12
# File 'lib/delayed_paperclip/process_job.rb', line 10

def perform(instance_klass, instance_id, attachment_name)
  DelayedPaperclip.process_job(instance_klass, instance_id, attachment_name.to_sym)
end