Module: CarrierWave::Workers::ProcessAssetMixin

Includes:
Base
Included in:
ActiveJob::ProcessAsset, ProcessAsset
Defined in:
lib/backgrounder/workers/process_asset_mixin.rb

Instance Attribute Summary

Attributes included from Base

#column, #id, #klass, #record

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Base

#initialize

Class Method Details

.included(base) ⇒ Object



8
9
10
# File 'lib/backgrounder/workers/process_asset_mixin.rb', line 8

def self.included(base)
  base.extend CarrierWave::Workers::ClassMethods
end

Instance Method Details

#perform(*args) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/backgrounder/workers/process_asset_mixin.rb', line 12

def perform(*args)
  record = super(*args)
  asset = record.send(:"#{column}")

  return unless record && asset_present?(asset)

  recreate_asset_versions!(asset)

  if record.respond_to?(:"#{column}_processing")
    record.update_attribute :"#{column}_processing", false
  end
end