zoeys.computer/lib/zoeyscomputer/gists/gist.ex

19 lines
335 B
Elixir
Raw Normal View History

2024-10-26 15:01:33 -04:00
defmodule Zoeyscomputer.Gists.Gist do
use Ecto.Schema
import Ecto.Changeset
schema "gists" do
field :code, :string
field :lang, :string
timestamps(type: :utc_datetime)
end
@doc false
def changeset(gist, attrs) do
gist
|> cast(attrs, [:code, :lang])
|> validate_required([:code, :lang])
end
end