Update customer.rb

This commit is contained in:
2016-05-02 13:10:52 -04:00
parent 0304acd2b2
commit c5164684ac

View File

@@ -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