artists: normalize group names.

Normalize artist group names following the same rules as artist other names.

This means artist group names now use underscores instead of spaces.
It also means extra space characters at the beginning and end of names
is stripped, and Unicode characters are normalized.

Fixes #4647, which was caused by users accidentally replacing group
names with a single space character when trying to remove a group.
This commit is contained in:
evazion
2022-01-20 00:09:52 -06:00
parent 0376765847
commit 02c9498860
3 changed files with 34 additions and 0 deletions

View File

@@ -9,6 +9,7 @@ class Artist < ApplicationRecord
deletable
normalize :name, :normalize_name
normalize :group_name, :normalize_other_name
normalize :other_names, :normalize_other_names
array_attribute :other_names # XXX must come after `normalize :other_names`