Refactor sync_by_id method in Estimate model to use EstimateSyncJob for syncing

This commit is contained in:
2026-02-28 07:50:23 -05:00
parent eee99e4d83
commit a80f59cc45

View File

@@ -27,12 +27,7 @@ class Estimate < ActiveRecord::Base
# sync only one estimate
def self.sync_by_id(id)
log "Syncing estimate #{id}"
qbo = Qbo.first
qbo.perform_authenticated_request do |access_token|
service = Quickbooks::Service::Estimate.new(company_id: qbo.realm_id, access_token: access_token)
process_estimate(service.fetch_by_id(id))
end
EstimateSyncJob.perform_later(id: id)
end
# sync only one estimate