Add importing html and save it to Article
Additionally defines a wizard logic which is partially unused yet.
This commit is contained in:
@ -2,11 +2,12 @@ defmodule Outlook.Articles.Article do
|
||||
use Ecto.Schema
|
||||
import Ecto.Changeset
|
||||
|
||||
alias Outlook.Articles.InternalTree
|
||||
alias Outlook.Authors.Author
|
||||
alias Outlook.Translations.Translation
|
||||
|
||||
schema "articles" do
|
||||
field :content, :string
|
||||
field :content, InternalTree
|
||||
field :date, :utc_datetime
|
||||
field :language, :string
|
||||
field :title, :string
|
||||
@ -20,7 +21,7 @@ defmodule Outlook.Articles.Article do
|
||||
@doc false
|
||||
def changeset(article, attrs) do
|
||||
article
|
||||
|> cast(attrs, [:title, :content, :url, :language, :date])
|
||||
|> validate_required([:title, :content, :url, :language, :date])
|
||||
|> cast(attrs, [:title, :content, :url, :language, :date, :author_id])
|
||||
|> validate_required([:title, :content, :url, :language, :date, :author_id])
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user