We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I don't understand how to use this library.
** (Ecto.ChangeError) value "+15551234567" for MyApp.Challenge.Sms.SmsRecord.phone in insert does not match type EctoPhoneNumber
"+15551234567"
MyApp.Challenge.Sms.SmsRecord.phone
insert
The text was updated successfully, but these errors were encountered:
I get the same error, when I have this schema:
... schema "users" do field :phone_number, EctoPhoneNumber ... end ...
And when I try this in iex:
MyApp.Repo.insert(%MyApp.User{phone_number: "+61412345678"})
Help please?
Sorry, something went wrong.
After further trial and error, I figured out that this works:
{:ok, phone_number} = EctoPhoneNumber.cast("+61412345678") MyApp.Repo.insert(%MyApp.User{phone_number: phone_number})
(and that first line raises a MatchError if the input is an invalid phone number).
But surely that's not the correct way to use this library?
No branches or pull requests
I don't understand how to use this library.
The text was updated successfully, but these errors were encountered: