mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2026-10-04 01:00:44 -04:00
Refactored all Sync Jobs into QboSyncJob
This commit is contained in:
1 parent
6fc8a18e93
commit
fd18205c10
8 files changed
+28
-128
No files matched your search
@@ -70,14 +70,12 @@ class QboBaseModel < ActiveRecord::Base
|
||||
|
||||
# Sync all entities, typically triggered by a scheduled task or manual sync request
|
||||
def self.sync
|
||||
job = "#{model_name.name}SyncJob".constantize
|
||||
job.perform_later(full_sync: true)
|
||||
QboSyncJob.perform_later(entity: model_name.name, full_sync: true)
|
||||
end
|
||||
|
||||
# Sync a single entity by ID, typically triggered by a webhook notification or manual sync request
|
||||
def self.sync_by_id(id)
|
||||
job = "#{model_name.name}SyncJob".constantize
|
||||
job.perform_later(id: id)
|
||||
QboSyncJob.perform_later(entity: model_name.name, id: id)
|
||||
end
|
||||
|
||||
# Flag used to update local without pushing to QBO.
|
||||
|
||||
Reference in new issue
Block a user