app/helpers/subtasks_helper.rb
#return an array of usernames, only if there are users assigned
return an array of usernames, only if there are users assigned
return an array of usernames only if there are users assigned
def list_users(subtask)
        usertasks = UserTask.where(subtask_id: subtask.id)
        if usertasks
            usernames = usertasks.collect do |usertask|
                User.find_by(id: usertask.user_id).username
            end
        else
            ["No Users Assigned"]
        end
    end
def list_users ( subtask ) usertasks = UserTask . where ( subtask_id : subtask . id ) if usertasks usernames = usertasks . collect do | usertask | User . find_by ( id : usertask . user_id ) . username end else [ "No Users Assigned" ] end end
return an array of usernames, only if there are users assigned
return an array of usernames only if there are users assigned
subtask
<not_specific>