opentelemetry-erlang-contrib/examples/basic_phoenix_ecto/lib/demo/accounts/user.ex

18 lines
271 B
Elixir

defmodule Demo.Accounts.User do
use Ecto.Schema
import Ecto.Changeset
schema "users" do
field :name, :string
timestamps()
end
@doc false
def changeset(user, attrs) do
user
|> cast(attrs, [:name])
|> validate_required([:name])
end
end