opentelemetry-erlang-contrib/examples/basic_phoenix_ecto/lib/demo/blog/post.ex

19 lines
309 B
Elixir

defmodule Demo.Blog.Post do
use Ecto.Schema
import Ecto.Changeset
schema "posts" do
field :body, :string
field :title, :string
timestamps()
end
@doc false
def changeset(post, attrs) do
post
|> cast(attrs, [:title, :body])
|> validate_required([:title, :body])
end
end