umts / incidents

Operator incident report tracking for the Springfield and Valley Area Transit Companies
MIT License
1 stars 1 forks source link

History pages always display "Unknown" for whodunnit #389

Open werebus opened 7 months ago

werebus commented 7 months ago

https://github.com/umts/incidents/blob/583ec9160e7e053b7b94bf4949cc622bc8a36cd1/app/views/incident_reports/history.haml#L15

https://github.com/umts/incidents/blob/583ec9160e7e053b7b94bf4949cc622bc8a36cd1/app/views/supervisor_reports/history.haml#L15

User.find('4').try(:name)
#=> nil
# Hmmm...
User.find('4')&.name
# `method_missing': undefined method `name' for #<User id: 4, ...

All user "names" are nil, because users don't have "names".

werebus commented 7 months ago

Likewise when the user is changed:

https://github.com/umts/incidents/blob/583ec9160e7e053b7b94bf4949cc622bc8a36cd1/app/views/incident_reports/_changes.haml#L23

https://github.com/umts/incidents/blob/583ec9160e7e053b7b94bf4949cc622bc8a36cd1/app/views/supervisor_reports/_changes.haml#L23