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:
parent
30c2db682e
commit
258a2c1489
1 changed files with 2 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue