mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2026-04-02 08:21:57 -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
|
# sync only one estimate
|
||||||
def self.sync_by_id(id)
|
def self.sync_by_id(id)
|
||||||
log "Syncing estimate #{id}"
|
EstimateSyncJob.perform_later(id: 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
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# sync only one estimate
|
# sync only one estimate
|
||||||
|
|||||||
Reference in New Issue
Block a user