mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2025-11-09 09:24:23 -05:00
Update customer.rb
This commit is contained in:
@@ -19,7 +19,6 @@ class Customer < ActiveRecord::Base
|
|||||||
|
|
||||||
validates_presence_of :id, :name
|
validates_presence_of :id, :name
|
||||||
|
|
||||||
|
|
||||||
self.primary_key = :id
|
self.primary_key = :id
|
||||||
|
|
||||||
# returns a human readable string
|
# returns a human readable string
|
||||||
@@ -108,8 +107,11 @@ class Customer < ActiveRecord::Base
|
|||||||
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
|
||||||
|
|
||||||
|
if count == 0
|
||||||
|
customers = service.all
|
||||||
|
else
|
||||||
customers = service.query(query)
|
customers = service.query(query)
|
||||||
customers = service.all if count == 0
|
end
|
||||||
|
|
||||||
customers.each do |customer|
|
customers.each do |customer|
|
||||||
qbo_customer = Customer.find_or_create_by(id: customer.id)
|
qbo_customer = Customer.find_or_create_by(id: customer.id)
|
||||||
|
|||||||
Reference in New Issue
Block a user