daddyz / phonelib

Ruby gem for phone validation and formatting using google libphonenumber library data
MIT License
1.06k stars 130 forks source link

Update validation: phone valid if one country is valid #238

Open shqear93 opened 3 years ago

shqear93 commented 3 years ago
validates :attribute, phone: { allow_blank: true, countries: [:us, :ca] }

Phone number should be valid if it's at least valid for one country from the provided list

daddyz commented 3 years ago

@shqear93 nice PR, can you make this behavior optional, maybe via config param? And additionally this behavior doesn't respect possible param, this is required too

shqear93 commented 2 years ago

@daddyz I'll work on that soon