-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
valid? resets input parameter #53
Comments
Thanks for the report @martinmalek. I consider this a bug. |
Hi @martinmalek, I released v1.3.0.beta0 today with some tests around the issue that you've reports. I can't reproduce them here. Is there something I'm missing? |
A little more information, there was a huge issue with the extension extraction code mutating the parameters. It's possible that this commit fixes the issue you've been seeing. |
I'm on 1.2.3. Seeing this issue. > raw_number
=> "1-801-848-3641 x02104"
> Phoner::Phone.valid?(raw_number)
=> true
> raw_number
=> "1-801-848-3641" Going to see if 1.3.0 fixes this. |
Don't know if this is the same bug or a new one, but still getting this result after updating to 1.3.0beta0 |
Wow, not the only function that has that issue. This also modifies raw_number... that's terrible. Phoner::Phone.parse(raw_number) |
For anyone who is using an older version of the gem (or until this is fixed in the most recent release) this worked for me. EDIT: it should go in an initializer.
|
@calebanderson have you tried using the beta? |
I haven't, but the |
@calebanderson good call! I fixed that and never pushed out a new release. I can release a new beta later - any chance you can try with master? |
@elskwid Sure I'll give it a shot. I've already looked over the code quite a bit and everything looked good. |
@elskwid Everything I checked out seems to be working great, at least as far as I can tell given my little knowledge about international phone numbers. |
@calebanderson I will push out a new version as soon as I get a chance (tonight or tomorrow morning). Will keep you posted. Thanks so much!! |
@calebanderson took longer than expected (what doesn't??!?!) but v1.3.0.beta1 is out for you. If it works I'll push out the final version in the days to come. |
Whenever I send a parameter which is not a valid phone number
Phoner::Phone.valid?(myParam) it is reset and returned as ""
Example:
myParam = "ABC123"
Phoner::Phone.valid?(myParam) => false
myParam is now ""
The text was updated successfully, but these errors were encountered: