Class: EstimatedLandedCostWorker
- Inherits:
-
Object
- Object
- EstimatedLandedCostWorker
- Includes:
- Sidekiq::Job
- Defined in:
- app/workers/estimated_landed_cost_worker.rb
Instance Method Summary collapse
Instance Method Details
#perform ⇒ Object
7 8 9 10 11 12 |
# File 'app/workers/estimated_landed_cost_worker.rb', line 7 def perform suppliers_list = Supplier.joins("inner join view_estimated_landed_costs on parties.id = view_estimated_landed_costs.supplier_id").where("parties.estimated_landed_cost_ptg > view_estimated_landed_costs.landed_cost_ptg").select("parties.*,view_estimated_landed_costs.landed_cost_ptg") suppliers_list.each do |s| s.update(estimated_landed_cost_ptg: s.landed_cost_ptg) end end |