From 03e1e7e0b270e3650f37c7f3b1708209be46ca14 Mon Sep 17 00:00:00 2001 From: Rick Barrette Date: Thu, 21 Jan 2016 12:15:20 -0500 Subject: [PATCH] Update users_show_hook_listener.rb Updating to the following conventions https://github.com/bbatsov/ruby-style-guide --- lib/users_show_hook_listener.rb | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/users_show_hook_listener.rb b/lib/users_show_hook_listener.rb index 042c3c5..a3d4323 100644 --- a/lib/users_show_hook_listener.rb +++ b/lib/users_show_hook_listener.rb @@ -12,16 +12,14 @@ class UsersShowHookListener < Redmine::Hook::ViewListener # View User def view_users_form(context={}) - selected = "" + # Update the users QboEmployee.update_all # Check to see if there is a quickbooks user attached to the issue - if not context[:user].qbo_employee_id.nil? then - selected = context[:user].qbo_employee_id - end + @selected = context[:user].qbo_employee_id unless context[:user].qbo_employee_id.nil? # Generate the drop down list of quickbooks contacts - return "

#{context[:form].select :qbo_employee_id, QboEmployee.all.pluck(:name, :id), :selected => selected, include_blank: true}

" + return "

#{context[:form].select :qbo_employee_id, QboEmployee.all.pluck(:name, :id), :selected => @selected, include_blank: true}

" end -end \ No newline at end of file +end