Closed p0wl closed 6 years ago
I would like to keep the \A in the regex since otherwise numbers with weird extensions are also handled differently.
can you add a testcase for an example (with a weird extension), so I can provide another fix? =)
Going to be fixed in https://github.com/joost/phony_rails/pull/182.
Hey @joost,
thanks for your work! As mentioned in #170, the error we found exists only when the default country code is set. I adjusted the test case and fixed the issue (all tests passed).
What do you think, is this a feasible solution? I also thought about removing brackets and then checking for a + in the beginning (
unless number.gsub(/[\(\)]/, '') =~ /\A\+/
), but it seems overdone to me.