diff options
author | Simponic <loganhunt@simponic.xyz> | 2022-12-20 01:06:18 -0700 |
---|---|---|
committer | Simponic <loganhunt@simponic.xyz> | 2022-12-21 17:21:36 -0700 |
commit | fed5d8a9e7b9500d317f2d8664cfe8ef4138154e (patch) | |
tree | f3d084146c2d410a4c1c8d95398599ceb1c8094f /lib/chessh/schema | |
parent | b18899ffaffad71a2b2f8783d97bcab876ab22a1 (diff) | |
download | chessh-fed5d8a9e7b9500d317f2d8664cfe8ef4138154e.tar.gz chessh-fed5d8a9e7b9500d317f2d8664cfe8ef4138154e.zip |
Add a simple echo server
Diffstat (limited to 'lib/chessh/schema')
-rw-r--r-- | lib/chessh/schema/player.ex | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/chessh/schema/player.ex b/lib/chessh/schema/player.ex index 5b7b904..4b6a324 100644 --- a/lib/chessh/schema/player.ex +++ b/lib/chessh/schema/player.ex @@ -14,15 +14,15 @@ defmodule Chessh.Player do timestamps() end - def registration_changeset(user, attrs, opts \\ []) do - user + def registration_changeset(player, attrs, opts \\ []) do + player |> cast(attrs, [:username, :password]) |> validate_username() |> validate_password(opts) end - def password_changeset(user, attrs, opts \\ []) do - user + def password_changeset(player, attrs, opts \\ []) do + player |> cast(attrs, [:password]) |> validate_confirmation(:password, message: "does not match password") |> validate_password(opts) |