Update customer.rb

This commit is contained in:
2016-05-17 13:28:41 -04:00
parent c72d375aea
commit fd8ca2d44d

View File

@@ -105,6 +105,8 @@ class Customer < ActiveRecord::Base
def self.sync
last = Qbo.first.last_sync
background do
query = "Select Id, DisplayName From Customer"
query << " Where Metadata.LastUpdatedTime >= '#{last.iso8601}' " if last
query << " Order By DisplayName "
@@ -121,6 +123,8 @@ class Customer < ActiveRecord::Base
end
end
end
# remove deleted customers
#where.not(customers.map(&:id)).destroy_all
end