mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2026-10-06 09:20:43 -04:00
Update customer.rb
This commit is contained in:
1 parent
c72d375aea
commit
fd8ca2d44d
1 file changed
+4
@@ -105,6 +105,8 @@ class Customer < ActiveRecord::Base
|
|||||||
def self.sync
|
def self.sync
|
||||||
last = Qbo.first.last_sync
|
last = Qbo.first.last_sync
|
||||||
|
|
||||||
|
background do
|
||||||
|
|
||||||
query = "Select Id, DisplayName From Customer"
|
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 "
|
query << " Order By DisplayName "
|
||||||
@@ -121,6 +123,8 @@ class Customer < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
# remove deleted customers
|
# remove deleted customers
|
||||||
#where.not(customers.map(&:id)).destroy_all
|
#where.not(customers.map(&:id)).destroy_all
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in new issue
Block a user