I’m refactoring my normalizes methods in Rails with tne new normalizes method. Lets take a look together.
Code in my project before the refactoring, for the username i use the unicode_normalice function to return a normalized form of str, using Unicode normalizations NFC, NFD, NFKC, or NFKD.
After refactoring the code it looks like this:
And we have a bit more clean code with less functions to test.