mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2025-11-08 17:04:23 -05:00
Update qbo_item.rb
This commit is contained in:
@@ -23,7 +23,7 @@ class QboItem < ActiveRecord::Base
|
|||||||
|
|
||||||
query = "SELECT Id, Name FROM Item"
|
query = "SELECT Id, Name FROM Item"
|
||||||
query << "WHERE Type = 'Service'"
|
query << "WHERE Type = 'Service'"
|
||||||
#query << "AND Metadata.LastUpdatedTime > '#{last}'" if last
|
#query << " AND Metadata.LastUpdatedTime > '#{last}' " if last
|
||||||
|
|
||||||
items = get_base.service.query()
|
items = get_base.service.query()
|
||||||
transaction do
|
transaction do
|
||||||
@@ -37,6 +37,6 @@ class QboItem < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
#remove deleted items
|
#remove deleted items
|
||||||
where.not(items.map(&:id)).destroy_all
|
QboItem.where.not(items.map(&:id)).destroy_all
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user