Add remarks to articles

This commit is contained in:
Thelonius Kort
2023-05-04 18:12:57 +02:00
parent 888e7575f0
commit d53eceb7a0
4 changed files with 16 additions and 1 deletions

View File

@ -12,6 +12,7 @@ defmodule Outlook.Articles.Article do
field :language, :string, default: "EN"
field :title, :string
field :url, :string
field :remarks, :string
belongs_to :author, Author
has_many :translations, Translation, on_delete: :delete_all
@ -21,7 +22,7 @@ defmodule Outlook.Articles.Article do
@doc false
def changeset(article, attrs) do
article
|> cast(attrs, [:title, :content, :url, :language, :date, :author_id])
|> cast(attrs, [:title, :content, :url, :language, :date, :author_id, :remarks])
|> validate_required([:title, :content, :url, :language, :date, :author_id])
|> foreign_key_constraint(:author_id)
end