mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2025-11-08 17:04:23 -05:00
Update customer.rb
This commit is contained in:
@@ -101,7 +101,12 @@ class Customer < ActiveRecord::Base
|
|||||||
# proforms a bruteforce sync operation
|
# proforms a bruteforce sync operation
|
||||||
# This needs to be simplified
|
# This needs to be simplified
|
||||||
def self.sync
|
def self.sync
|
||||||
customers = get_base.service.query("SELECT Id, DisplayName FROM Customer WHERE Metadata.LastUpdatedTime>'#{Qbo.first.last_sync}' ")
|
last = Qbo.first.last_sync
|
||||||
|
|
||||||
|
query = "SELECT Id, DisplayName FROM Customer"
|
||||||
|
query << " WHERE Metadata.LastUpdatedTime>'#{last}' " if last
|
||||||
|
|
||||||
|
customers = get_base.service.query()
|
||||||
|
|
||||||
transaction do
|
transaction do
|
||||||
# Update the customer table
|
# Update the customer table
|
||||||
|
|||||||
Reference in New Issue
Block a user