The parameter email_or_phone_number comes from a client side and I need this for an authentication. However, the model has email and phone number fields separately.
What is the right way to parse the email_or_phone_number attribute, so then I could use find_by to find a user?
find_by(email: email, phone_number: phone_number)
If it's number, then it should become phone_number, but if it's not, then that is supposed to be an email.