Add first step of creating an Article
This commit is contained in:
16
lib/outlook/articles/raw_html_input.ex
Normal file
16
lib/outlook/articles/raw_html_input.ex
Normal file
@ -0,0 +1,16 @@
|
||||
defmodule Outlook.Articles.RawHtmlInput do
|
||||
use Ecto.Schema
|
||||
import Ecto.Changeset
|
||||
|
||||
embedded_schema do
|
||||
field :content, :string
|
||||
end
|
||||
|
||||
@doc false
|
||||
def changeset(html_input, attrs) do
|
||||
html_input
|
||||
|> cast(attrs, [:content])
|
||||
|> validate_required([:content])
|
||||
|> validate_length(:content, min: 200)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user