From c5164684ac253951346e7b9183e59e226ce21011 Mon Sep 17 00:00:00 2001 From: Rick Barrette Date: Mon, 2 May 2016 13:10:52 -0400 Subject: [PATCH] Update customer.rb --- app/models/customer.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/models/customer.rb b/app/models/customer.rb index 84dfa5c..43554ad 100644 --- a/app/models/customer.rb +++ b/app/models/customer.rb @@ -101,7 +101,12 @@ class Customer < ActiveRecord::Base # proforms a bruteforce sync operation # This needs to be simplified 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 # Update the customer table