Update qbo_invoice.rb

This commit is contained in:
2016-08-03 16:35:04 -04:00
committed by GitHub
parent a266da2cd7
commit 01b4bb4e53

View File

@@ -54,11 +54,9 @@ class QboInvoice < ActiveRecord::Base
qbo_invoice.save!
# Scan the line items for hashtags and attach to the applicable issues
lines = invoice.line_items
lines.each { |line|
issues = line.description.scan(/#(\w+)/).flatten
issues.each { |issue|
i = issue.find_by_id(issue.to_i)
invoice.line_items.each { |line|
line.description.scan(/#(\w+)/).flatten.each { |issue|
i = Issue.find_by_id(issue.to_i)
i.qbo_invoice = issue.to_i
i.save!
}