Fix Frozen String Error in Commercials Controller

`errors_text` is a frozen string, so `<<` leads to an exception when trying to generate the error message.

https://sentry.cs10.org/share/issue/7867fdaf8eba4387ae2789fd5f1cff3b/
if you want a production example. :)
This commit is contained in:
Michael Ball 2020-12-04 16:23:31 -08:00 committed by Henne Vogelsang
parent 30c2db682e
commit 258a2c1489
No known key found for this signature in database
GPG key ID: 9D6164C2955FADE0

View file

@ -65,8 +65,8 @@ module Admin
flash[:notice] = 'Successfully added commercials.'
else
errors_text = ''
errors_text << 'Unable to find event with ID: ' + errors[:no_event].join(', ') + '. ' if errors[:no_event].any?
errors_text << 'There were some errors: ' + errors[:validation_errors].join('. ') if errors[:validation_errors].any?
errors_text += 'Unable to find event with ID: ' + errors[:no_event].join(', ') + '. ' if errors[:no_event].any?
errors_text += 'There were some errors: ' + errors[:validation_errors].join('. ') if errors[:validation_errors].any?
flash[:error] = errors_text
end