Update customer.rb

This commit is contained in:
2016-05-17 13:00:59 -04:00
parent 7503c68820
commit 684e7a45aa

View File

@@ -107,7 +107,7 @@ class Customer < ActiveRecord::Base
query = "Select Id, DisplayName From Customer"
query << " Where Metadata.LastUpdatedTime >= '#{last}' " if last
query << " Order By DisplayName"
query << " Order By DisplayName "
customers = Qbo.get_base(:customer).service.query_in_batches(query, per_page: 100) do |batch|
batch.each do |customer|
@@ -115,8 +115,8 @@ class Customer < ActiveRecord::Base
qbo_customer = Customer.find_or_create_by(id: customer.id)
qbo_customer.update_column(:name, customer.display_name)
qbo_customer.update_column(:id, customer.id)
}
}
end
end
# remove deleted customers
#where.not(customers.map(&:id)).destroy_all