Add the module to represent a blogpost.
This commit is contained in:
parent
f7c9ad7da9
commit
55be98eae9
|
@ -1,8 +1,8 @@
|
||||||
defmodule JOL.Blog.Post do
|
defmodule JOL.Blog.Post do
|
||||||
@enforce_keys [:title, :body, :draft, :date, :tags]
|
@enforce_keys [:author, :draft, :title, :body, :tags, :date]
|
||||||
defstruct [:title, :body, :draft, :date, :tags]
|
defstruct [:author, :draft, :title, :body, :tags, :date]
|
||||||
|
|
||||||
def build(_filename, attrs, body) do
|
def build(_filename, attrs, body) do
|
||||||
struct!(__MODULE__, [body: body] ++ Map.to_list(attrs))
|
struct!(__MODULE__, [author: "Jessica Phoenix Canady", body: body] ++ Map.to_list(attrs))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue