antes de viaje
This commit is contained in:
@ -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
|
||||
|
||||
Reference in New Issue
Block a user