~afontaine/home

79c3f31ea2e416d0bdd3ddadacc258268ff6c066 — Andrew Fontaine 7 months ago c559bfe
Set author in post changeset

It's required, and I just missed this when I added it to the schema way back.
1 files changed, 2 insertions(+), 2 deletions(-)

M apps/blog/lib/blog/content/post.ex
M apps/blog/lib/blog/content/post.ex => apps/blog/lib/blog/content/post.ex +2 -2
@@ 20,8 20,8 @@ defmodule Blog.Content.Post do
  @doc false
  def changeset(post, attrs) do
    post
    |> cast(attrs, [:subject, :text, :message_id])
    |> validate_required([:subject, :text, :message_id])
    |> cast(attrs, [:subject, :text, :message_id, :author])
    |> validate_required([:subject, :text, :message_id, :author])
    |> unique_constraint(:message_id)
    |> slugify(:subject)
    |> put_assoc(:tags, attrs.tags)