Sha256: 90a51c7a9eaa52cb512630d16bb7b52db43e252cc7f209ff294f45470a1ca071
Contents?: true
Size: 1.07 KB
Versions: 11
Compression:
Stored size: 1.07 KB
Contents
require 'delayed_job' module DelayedPaperclip module Jobs class DelayedJob < Struct.new(:instance_klass, :instance_id, :attachment_name) if defined?(::Delayed::DeserializationError) # this is available in newer versions of DelayedJob. Using the newee Job api thus. def self.enqueue_delayed_paperclip(instance_klass, instance_id, attachment_name) ::Delayed::Job.enqueue( :payload_object => new(instance_klass, instance_id, attachment_name), :priority => instance_klass.constantize.attachment_definitions[attachment_name][:delayed][:priority].to_i ) end else def self.enqueue_delayed_paperclip(instance_klass, instance_id, attachment_name) ::Delayed::Job.enqueue( new(instance_klass, instance_id, attachment_name), instance_klass.constantize.attachment_definitions[attachment_name][:delayed][:priority].to_i ) end end def perform DelayedPaperclip.process_job(instance_klass, instance_id, attachment_name) end end end end
Version data entries
11 entries across 11 versions & 1 rubygems