Wouldn't applying this same logic to the email field solve the problem? That is:

    email.gsub('@', '.')