This related to my other question, but I’m asking a new one for clarity.
Using the built-in validation_confirmation
I’m getting:
undefined function validate_confirmation/4
.
It’s an Ecto(?) function, so I’m stumped on this one. None of the other functions there fail, only validation_confirmation
. Am I missing an import somewhere? Undefined error makes no sense here.
defp validate_email(changeset) do
IO.inspect(changeset)
changeset
|> validate_required([:email])
|> validate_format(:email, ~r/^[^\s]+@[^\s]+$/, message: "must have the @ sign and no spaces")
|> validate_length(:email, max: 160)
|> unsafe_validate_unique(:email, TurnStile.Repo)
|> unique_constraint(:email)
|> validate_confirmation(changeset, :password, message: "does not match password")
end