Added garbage colllection for instance variables

This commit is contained in:
2016-03-10 20:38:15 -05:00
parent 5104509106
commit 2c3503f4ac
2 changed files with 8 additions and 4 deletions

View File

@@ -22,8 +22,8 @@ class IssuesFormHookListener < Redmine::Hook::ViewListener
# Check to see if there is a quickbooks user attached to the issue # Check to see if there is a quickbooks user attached to the issue
@selected_customer = context[:issue].qbo_customer.id if context[:issue].qbo_customer @selected_customer = context[:issue].qbo_customer.id if context[:issue].qbo_customer
@selected_item = context[:issue].qbo_item.id if context[:issue].qbo_item @selected_item = context[:issue].qbo_item.id if context[:issue].qbo_item
@selected_invoice = context[:issue].qbo_invoice.id if context[:issue].qbo_invoice @selected_invoice = context[:issue].qbo_invoice ? context[:issue].qbo_invoice.id : nil
@selected_estimate = context[:issue].qbo_estimate.id if context[:issue].qbo_estimate @selected_estimate = context[:issue].qbo_estimate ? context[:issue].qbo_estimate.id : nil
# Generate the drop down list of quickbooks customers # Generate the drop down list of quickbooks customers
@select_customer = context[:form].select :qbo_customer_id, QboCustomer.all.pluck(:name, :id), :selected => @selected_customer, include_blank: true @select_customer = context[:form].select :qbo_customer_id, QboCustomer.all.pluck(:name, :id), :selected => @selected_customer, include_blank: true

View File

@@ -21,11 +21,13 @@ class IssuesShowHookListener < Redmine::Hook::ViewListener
issue = context[:issue] issue = context[:issue]
# Check to see if there is a quickbooks user attached to the issue # Check to see if there is a quickbooks user attached to the issue
@customer = issue.qbo_customer.name if issue.qbo_customer @customer = issue.qbo_customer ? issue.qbo_customer.name : nil
# Check to see if there is a quickbooks item attached to the issue # Check to see if there is a quickbooks item attached to the issue
@item = issue.qbo_item.name if issue.qbo_item @item = issue.qbo_item ? issue.qbo_item.name : nil
@estimate = nil
@estimate_link = nil
# Estimate Number # Estimate Number
if issue.qbo_estimate if issue.qbo_estimate
QboEstimate.update(issue.qbo_estimate.id) QboEstimate.update(issue.qbo_estimate.id)
@@ -33,6 +35,8 @@ class IssuesShowHookListener < Redmine::Hook::ViewListener
@estimate_link = link_to @estimate, "#{Redmine::Utils::relative_url_root }/qbo/estimate/#{issue.qbo_estimate.id}", :target => "_blank" @estimate_link = link_to @estimate, "#{Redmine::Utils::relative_url_root }/qbo/estimate/#{issue.qbo_estimate.id}", :target => "_blank"
end end
@invoice = nil
@invo = nil
# Invoice Number # Invoice Number
if issue.qbo_invoice if issue.qbo_invoice
QboInvoice.update(issue.qbo_invoice.id) QboInvoice.update(issue.qbo_invoice.id)