legendary-doc-site/apps/content/lib/content/term.ex

19 lines
387 B
Elixir
Raw Normal View History

defmodule Legendary.Content.Term do
2020-07-20 22:04:04 +00:00
@moduledoc """
Represents one 'term', i.e. a grouping under a taxonomy.
"""
use Ecto.Schema
import Ecto.Changeset
2020-07-28 15:54:24 +00:00
schema "terms" do
2020-07-20 22:04:04 +00:00
field :name, :string
field :slug, :string
field :term_group, :integer
end
def changeset(struct, params \\ %{}) do
struct
2020-07-28 15:54:24 +00:00
|> cast(params, [:id, :name, :slug, :term_group])
2020-07-20 22:04:04 +00:00
end
end