mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2026-04-02 16:21:58 -04:00
Refactor sync_by_id method in Estimate model to use EstimateSyncJob for syncing
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user