Db:seed_fu fails on 002_groups.rb during upgrade: Validation failed: Name has already been taken

Where did the “Me too!” button go?

This happens when you have an existing group or user (!!!) called anonymous.

We have many forums where anonymous was used as a username after an import.
The commit mentions

This PR introduces two new auto groups, anonymous_users and logged_in_users

but apparently the group was eventually called anonymous without _users.

That’s a shame because

  • anonymous makes it unclear whether it is a user group or a single user
  • the risk of a clash with an existing group or user is much higher without the _users

Suggested solutions:
1 - name the group anonymous_users after all, it’s more in line with logged_in_users and reduces the clash risk enormously
2 - at least detect the clash and rename the existing user or group instead of erroring out

2 Likes