Files
phoenix-ausblick/lib/outlook/authors/author.ex
Thelonius Kort b7bd9195b6 Add importing html and save it to Article
Additionally defines a wizard logic which is partially unused yet.
2022-12-29 16:43:52 +01:00

24 lines
505 B
Elixir

defmodule Outlook.Authors.Author do
use Ecto.Schema
import Ecto.Changeset
alias Outlook.Articles.Article
schema "authors" do
field :description, :string
field :homepage_name, :string
field :homepage_url, :string
field :name, :string
has_many :articles, Article
timestamps()
end
@doc false
def changeset(author, attrs) do
author
|> cast(attrs, [:name, :description, :homepage_name, :homepage_url])
|> validate_required([:name, :description])
end
end