Add Autor schema
This commit is contained in:
@ -45,7 +45,7 @@ implement to_param protocol (no more needed for Outlook.Translations.Translation
|
||||
url_org: a.url,
|
||||
date_org: a.date,
|
||||
autor_name: au.name,
|
||||
author_id: au.id
|
||||
autor_id: au.id
|
||||
],
|
||||
where: t.id == ^id and t.public == true
|
||||
case Repo.one(q) do
|
||||
|
||||
@ -11,7 +11,7 @@ defmodule Outlook.Public.Artikel do
|
||||
field :url_org, :string
|
||||
field :date_org, :utc_datetime
|
||||
field :autor_name, :string
|
||||
field :author_id, :integer
|
||||
field :autor_id, :integer
|
||||
field :teaser, :string
|
||||
# field :autor, Autor
|
||||
end
|
||||
|
||||
13
lib/outlook/public/autor.ex
Normal file
13
lib/outlook/public/autor.ex
Normal file
@ -0,0 +1,13 @@
|
||||
defmodule Outlook.Public.Autor do
|
||||
use Ecto.Schema
|
||||
|
||||
alias Outlook.Public.Artikel
|
||||
|
||||
embedded_schema do
|
||||
field :name, :string
|
||||
field :description, :string
|
||||
field :homepage_name, :string
|
||||
field :homepage_url, :string
|
||||
has_many :artikel, Artikel
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user