Files
something-erlang/lib/something_erlang/forums/thread.ex
2022-05-23 15:57:15 +02:00

19 lines
346 B
Elixir

defmodule SomethingErlang.Forums.Thread do
use Ecto.Schema
import Ecto.Changeset
schema "threads" do
field :thread_id, :integer
field :title, :string
timestamps()
end
@doc false
def changeset(thread, attrs) do
thread
|> cast(attrs, [:title, :thread_id])
|> validate_required([:title, :thread_id])
end
end