Skip to content

Commit

Permalink
Update README code example.
Browse files Browse the repository at this point in the history
Validate normalized number is present since the phony_normalize method will normalize strings with random letters to nil. But only validate if phone_number is present.
  • Loading branch information
mattruzicka authored Jun 20, 2017
1 parent ff0a589 commit e44e76e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ You can validate against the normalized input as opposed to the raw input:

```ruby
phony_normalize :phone_number, as: :phone_number_normalized, default_country_code: 'US'
validates_plausible_phone :phone_number_normalized
validates_plausible_phone :phone_number_normalized, presence: true, if: :phone_number?
```

Validation supports phone numbers with extension, such as `+18181231234 x1234` or `'+1 (818)151-5483 #4312'` out-of-the-box.
Expand Down

0 comments on commit e44e76e

Please sign in to comment.