We have to delete :groups otherwise update_attributes will complain about unknown groups attribute. We could build another hash without it and use it instead but I don't see the advantage since we use it only as user's attributes hash later.