Class: Effective::ProcessWithActiveJob

Inherits:
Object
  • Object
show all
Defined in:
app/jobs/effective/process_with_active_job.rb

Instance Method Summary collapse

Instance Method Details

#perform(id) ⇒ Object



4
5
6
7
8
9
# File 'app/jobs/effective/process_with_active_job.rb', line 4

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