loomio/loomio — pull request #636 by fuzzytern (2013-04-03 13:55:53+00:00)
Title: Generate usernames for names with non-ASCII characters

This is the fix for the following issue
> User's with non-ASCII characters in their name are hard to mention #456

The generate_username method for the User class is now using the `parameterize` function from the class ActiveSupport::Inflector. The output of this function is gsub'ed to keep only [a-z0-9] characters.

This also adds a migration to update all usernames using this new function, thus updating all the erroneous usernames. This operation is critical and exceptional. Usernames shouldn't be tinkered with too much.

An alternative to updating all usernames would have been to update only the ones for users who have non-ASCII characters in their names, but this is not consistent because a user might have changed his name since the username was generated.