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

19 lines
403 B
Elixir
Raw Normal View History

2020-07-20 22:04:04 +00:00
defmodule Content.Termmeta do
@moduledoc """
Represents one piece of metadata around one "term" (a grouping under a taxonomy).
"""
use Ecto.Schema
import Ecto.Changeset
2020-07-28 15:54:24 +00:00
schema "termmeta" do
2020-07-20 22:04:04 +00:00
field :term_id, :integer
2020-07-28 15:54:24 +00:00
field :key, :string
field :value, :string
2020-07-20 22:04:04 +00:00
end
def changeset(struct, params \\ %{}) do
struct
2020-07-28 15:54:24 +00:00
|> cast(params, [:id, :term_id, :key, :value])
2020-07-20 22:04:04 +00:00
end
end