mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2025-11-08 17:04:23 -05:00
Update users_show_hook_listener.rb
Updating to the following conventions https://github.com/bbatsov/ruby-style-guide
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user