diff --git a/lib/nulla/user.ex b/lib/nulla/user.ex index a8abb7e..ab732d6 100644 --- a/lib/nulla/user.ex +++ b/lib/nulla/user.ex @@ -3,7 +3,7 @@ defmodule Nulla.User do import Ecto.Changeset schema "users" do - field :name, :string + field :username, :string field :email, :string field :password, :string field :is_moderator, :boolean, default: false @@ -29,7 +29,7 @@ defmodule Nulla.User do @doc false def changeset(user, attrs) do user - |> cast(attrs, [:name, :email, :password, :is_moderator, :realname, :bio, :location, :birthday, :fields, :follow_approval, :is_bot, :is_discoverable, :is_indexable, :is_memorial, :private_key, :public_key, :avater, :banner]) - |> validate_required([:name, :email, :password, :is_moderator, :realname, :bio, :location, :birthday, :fields, :follow_approval, :is_bot, :is_discoverable, :is_indexable, :is_memorial, :private_key, :public_key, :avater, :banner]) + |> cast(attrs, [:username, :email, :password, :is_moderator, :realname, :bio, :location, :birthday, :fields, :follow_approval, :is_bot, :is_discoverable, :is_indexable, :is_memorial, :private_key, :public_key, :avater, :banner]) + |> validate_required([:username, :email, :password, :is_moderator, :realname, :bio, :location, :birthday, :fields, :follow_approval, :is_bot, :is_discoverable, :is_indexable, :is_memorial, :private_key, :public_key, :avater, :banner]) end end