I'm relatively new to Rails and ActiveRecord. I'm storing phone numbers in ActiveRecord fields (phone_number) that can be in a number of formats "+1 928 929 3829" or "393 938 0293" or "392-937-9283" (you get the idea).
Later I'm capturing a 10 digit phone number (so it will always be like "3939380293") and then trying to match that to my ActiveRecord phone number field. The operation I want to do is match against the last 10 numeric characters of phone_number.
I've tried looking at the different SQL-type query constraints that you can use in queries, but I'm having trouble finding exactly what I need or making the logic leap.
Can anyone offer some advice here?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.