No Duplicates!

This commit is contained in:
2016-09-01 01:10:17 -04:00
committed by GitHub
parent f179b04af1
commit ce88cdd258

View File

@@ -63,7 +63,7 @@ class QboInvoice < ActiveRecord::Base
if line.description
line.description.scan(/#(\w+)/).flatten.each { |issue|
i = Issue.find_by_id(issue.to_i)
i.qbo_invoice = QboInvoice.find_by_id(invoice.id.to_i)
i.qbo_invoice << QboInvoice.find_by_id(invoice.id.to_i) if not i.qbo_invoice_ids.include?(invoice.id)
i.save!
# update the invoive custom fields with infomation from the work ticket if available