Update users_show_hook_listener.rb

Updating to the following conventions
https://github.com/bbatsov/ruby-style-guide
This commit is contained in:
2016-01-21 12:15:20 -05:00
parent aa3fefd628
commit 03e1e7e0b2

View File

@@ -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 "<p>#{context[:form].select :qbo_employee_id, QboEmployee.all.pluck(:name, :id), :selected => selected, include_blank: true}</p>"
return "<p>#{context[:form].select :qbo_employee_id, QboEmployee.all.pluck(:name, :id), :selected => @selected, include_blank: true}</p>"
end
end
end