From fed5d8a9e7b9500d317f2d8664cfe8ef4138154e Mon Sep 17 00:00:00 2001 From: Simponic Date: Tue, 20 Dec 2022 01:06:18 -0700 Subject: Add a simple echo server --- lib/chessh/schema/player.ex | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/chessh/schema') 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) -- cgit v1.2.3-70-g09d2