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

42 lines
780 B
Elixir
Raw Normal View History

defmodule Legendary.Content.Link do
2020-07-20 22:04:04 +00:00
@moduledoc """
A link for the (deprecated) link roll feature.
"""
use Ecto.Schema
import Ecto.Changeset
2020-07-28 15:54:24 +00:00
schema "links" do
field :url, :string
field :name, :string
field :image, :string
field :target, :string
field :description, :string
field :visible, :string
field :owner, :integer
field :rating, :integer
field :updated, :naive_datetime
field :rel, :string
field :notes, :string
field :rss, :string
2020-07-20 22:04:04 +00:00
end
def changeset(struct, params \\ %{}) do
struct
|> cast(params, [
2020-07-28 15:54:24 +00:00
:id,
:url,
:name,
:image,
:target,
:description,
:visible,
:owner,
:rating,
:updated,
:rel,
:notes,
:rss
2020-07-20 22:04:04 +00:00
])
end
end