From 6e092922ac2062e5b808feec5b691f254ad63d86 Mon Sep 17 00:00:00 2001 From: Rick Barrette Date: Tue, 17 May 2016 13:42:32 -0400 Subject: [PATCH] Update customer.rb --- app/models/customer.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/models/customer.rb b/app/models/customer.rb index 8013a03..dc4f6cd 100644 --- a/app/models/customer.rb +++ b/app/models/customer.rb @@ -106,11 +106,12 @@ class Customer < ActiveRecord::Base last = Qbo.first.last_sync query = "Select Id, DisplayName From Customer" - #query << " Where Metadata.LastUpdatedTime >= '#{last.iso8601}' " if last + query << " Where Metadata.LastUpdatedTime >= '#{last.iso8601}' " if last query << " Order By DisplayName " #without_callback(:save, :before, :save) do - customers = Qbo.get_base(:customer).service.query_in_batches(query, per_page: 100) do |batch| + #customers = Qbo.get_base(:customer).service.query_in_batches(query, per_page: 100) do |batch| + customers = Qbo.get_base(:customer).service.all batch.each do |customer| # Update the customer table qbo_customer = Customer.find_or_create_by(id: customer.id)