Sha256: 85c27fb4b3e4cb42fb6b083900ae742b67d906b1729234697e6addd50e896bec
Contents?: true
Size: 903 Bytes
Versions: 1
Compression:
Stored size: 903 Bytes
Contents
# encoding: utf-8 module CarrierWave module Workers class ProcessAsset < Struct.new(:klass, :id, :column) include ::Sidekiq::Worker if defined?(::Sidekiq) @queue = :process_asset def self.perform(*args) new(*args).perform end def perform(*args) set_args(*args) unless args.empty? resource = klass.is_a?(String) ? klass.constantize : klass record = resource.find id if record record.send(:"process_#{column}_upload=", true) if record.send(:"#{column}").recreate_versions! && record.respond_to?(:"#{column}_processing") record.send :"#{column}_processing=", nil record.save! end end end def set_args(klass, id, column) self.klass, self.id, self.column = klass, id, column end end # ProcessAsset end # Workers end # Backgrounder
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
carrierwave_backgrounder-0.0.8 | lib/backgrounder/workers/process_asset.rb |