antes de viaje

This commit is contained in:
SantiSvk
2024-06-18 11:53:49 -03:00
parent 5101a745aa
commit e33f8ad22f
6 changed files with 111 additions and 157 deletions

View File

@ -3,6 +3,7 @@ defmodule Derivantes.Accounts.User do
import Ecto.Changeset
schema "users" do
field :matricula, :string
field :email, :string
field :password, :string, virtual: true, redact: true
field :hashed_password, :string, redact: true
@ -36,9 +37,15 @@ defmodule Derivantes.Accounts.User do
"""
def registration_changeset(user, attrs, opts \\ []) do
user
|> cast(attrs, [:email, :password])
|> cast(attrs, [:email, :password, :matricula])
|> validate_email(opts)
|> validate_password(opts)
|> validate_matricula(opts)
end
defp validate_matricula(changeset, opts) do
IO.inspect(opts)
changeset
end
defp validate_email(changeset, opts) do