From b1cf8363a9b1d01777187d912bc9cf4cc5518ffb Mon Sep 17 00:00:00 2001 From: Rick Barrette Date: Tue, 29 Mar 2016 09:19:39 -0400 Subject: [PATCH] Update issues_form_hook_listener.rb Sort the options! --- lib/issues_form_hook_listener.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/issues_form_hook_listener.rb b/lib/issues_form_hook_listener.rb index a1ddc70..63ece79 100644 --- a/lib/issues_form_hook_listener.rb +++ b/lib/issues_form_hook_listener.rb @@ -26,10 +26,10 @@ class IssuesFormHookListener < Redmine::Hook::ViewListener selected_estimate = context[:issue].qbo_estimate.id if context[:issue].qbo_estimate # 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).sort, :selected => selected_customer, include_blank: true # Generate the drop down list of quickbooks items - @select_item = context[:form].select :qbo_item_id, QboItem.all.pluck(:name, :id), :selected => selected_item, include_blank: true + @select_item = context[:form].select :qbo_item_id, QboItem.all.pluck(:name, :id).sort, :selected => selected_item, include_blank: true # Generate the drop down list of quickbooks invoices @select_invoice = context[:form].select :qbo_invoice_id, QboInvoice.all.pluck(:doc_number, :id).sort! {|x, y| y <=> x}, :selected => selected_invoice, include_blank: true