Class: Effective::ProcessWithSuckerPunchJob

Inherits:
Object
  • Object
show all
Includes:
SuckerPunch::Job
Defined in:
app/jobs/effective/process_with_sucker_punch_job.rb

Instance Method Summary collapse

Instance Method Details

#perform(id) ⇒ Object



7
8
9
10
11
12
# File 'app/jobs/effective/process_with_sucker_punch_job.rb', line 7

def perform(id)
  ActiveRecord::Base.connection_pool.with_connection do
    asset = id.kind_of?(Effective::Asset) ? id : Effective::Asset.where(id: (id.to_i rescue 0)).first
    asset.process! if asset
  end
end