aboutsummaryrefslogtreecommitdiff
path: root/lib/chessh/schema/player.ex
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chessh/schema/player.ex')
-rw-r--r--lib/chessh/schema/player.ex7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/chessh/schema/player.ex b/lib/chessh/schema/player.ex
index 7d9bb6e..d04ed3e 100644
--- a/lib/chessh/schema/player.ex
+++ b/lib/chessh/schema/player.ex
@@ -9,6 +9,8 @@ defmodule Chessh.Player do
field(:password, :string, virtual: true)
field(:hashed_password, :string)
+ has_many(:keys, Chessh.Key)
+
timestamps()
end
@@ -52,7 +54,6 @@ defmodule Chessh.Player do
message: "only letters, numbers, underscores, and hyphens allowed"
)
|> unique_constraint(:username)
- |> lowercase(:username)
end
defp validate_password(changeset, opts) do
@@ -74,8 +75,4 @@ defmodule Chessh.Player do
changeset
end
end
-
- defp lowercase(changeset, field) do
- Map.update!(changeset, field, &String.downcase/1)
- end
end