חפש מזהה משתמש לפי שם משתמש או כתובת דוא"ל

What I was looking for turned out to be this:

User.find_by_username(username)&.id