Add remarks field to translations
This commit is contained in:
@ -15,6 +15,7 @@ defmodule Outlook.Translations.Translation do
|
||||
field :public_content, :string
|
||||
field :title, :string
|
||||
field :unauthorized, :boolean, default: false
|
||||
field :remarks, :string
|
||||
belongs_to :user, User
|
||||
belongs_to :article, Article
|
||||
|
||||
@ -24,7 +25,7 @@ defmodule Outlook.Translations.Translation do
|
||||
@doc false
|
||||
def changeset(translation, attrs) do
|
||||
translation
|
||||
|> cast(attrs, [:language, :title, :teaser, :date, :public, :unauthorized, :article_id, :public_content])
|
||||
|> cast(attrs, [:language, :title, :teaser, :date, :public, :unauthorized, :article_id, :public_content, :remarks])
|
||||
|> cast(attrs, [:content])
|
||||
|> validate_required([:language, :title, :content, :date, :public, :unauthorized, :article_id])
|
||||
|> unique_constraint([:language, :article_id],
|
||||
|
||||
Reference in New Issue
Block a user