mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2025-11-08 17:04:23 -05:00
Update customer.rb
This commit is contained in:
@@ -110,6 +110,8 @@ class Customer < ActiveRecord::Base
|
|||||||
customers.each { |customer|
|
customers.each { |customer|
|
||||||
|
|
||||||
background do
|
background do
|
||||||
|
Customer.without_callback(:initialize, :after, :pull) do
|
||||||
|
Customer.without_callback(:save, :before, :push) do
|
||||||
qbo_customer = Customer.find_or_create_by(id: customer.id)
|
qbo_customer = Customer.find_or_create_by(id: customer.id)
|
||||||
# only update if diffrent
|
# only update if diffrent
|
||||||
if qbo_customer.new_record?
|
if qbo_customer.new_record?
|
||||||
@@ -118,6 +120,8 @@ class Customer < ActiveRecord::Base
|
|||||||
qbo_customer.save!
|
qbo_customer.save!
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user