We use a separate IDP for authentication.
Sometimes we nee to change people’s email addresses in the IDP and on Discourse for old users who haven’t logged in for a while. We do this using this:
./launcher enter app
rails c
u = User.find_by_email('jim@contoso.com')
u.update(email: 'jim@fabrikam.com')
Except for a particular user he has a primary and secondary email address in Discourse. I think this is because this user was just merged from another. The secondary is the correct address.
I’ve tried the above command but it returns false and no changes seem to have been made.
Does anyone know how to fix this situation? I would like for the user to just have a primary address. Thanks!