`TagsConverter` creates an empty tag when the input is blank
czarnecki opened this issue · 0 comments
czarnecki commented
TagsConverter
simply calls String#split(String)
which creates an array which only contains the empty string when the input is empty.
That data is then simply passed along further with no validation anywhere.
Because of this that empty string gets saved in the database.
As a work around EditBudgetForm
removes the first element of the tags list, if it's not empty.
This means the following steps are necessary to remedy the error:
- Fix
TagsConverter
to properly handle empty input - Create a migration that removes the invalid data
- Remove the work around from
EditBudgetForm