How can I change user primary email?

There are many topics discussing this. You can visit the user’s profile page and change it but they’ll still need to verify their address, which is almost always a good idea.

If you want to take matters into your own hands, you can do it from the rails console. It’s much safer than direct database queries.

This might work

u=User.find_by_username("pat") 
UserEmail.find_by(user_id: u.id).first.update (email: "pat@gmail.com")


7 Likes