diff --git a/lib/philomena/conversations/conversation.ex b/lib/philomena/conversations/conversation.ex index 07e3f4ab..ac188f1d 100644 --- a/lib/philomena/conversations/conversation.ex +++ b/lib/philomena/conversations/conversation.ex @@ -57,7 +57,7 @@ defmodule Philomena.Conversations.Conversation do |> put_recipient() |> set_slug() |> set_last_message() - |> cast_assoc(:messages, with: {Message, :creation_changeset, [from]}) + |> cast_assoc(:messages, with: &Message.creation_changeset(&1, &2, from)) |> validate_length(:messages, is: 1) end diff --git a/lib/philomena/topics/topic.ex b/lib/philomena/topics/topic.ex index efc49ce4..0db30126 100644 --- a/lib/philomena/topics/topic.ex +++ b/lib/philomena/topics/topic.ex @@ -59,7 +59,7 @@ defmodule Philomena.Topics.Topic do |> change(forum: forum, user: attribution[:user]) |> validate_required(:forum) |> cast_assoc(:poll, with: &Poll.update_changeset/2) - |> cast_assoc(:posts, with: {Post, :topic_creation_changeset, [attribution, anonymous?]}) + |> cast_assoc(:posts, with: &Post.topic_creation_changeset(&1, &2, attribution, anonymous?)) |> validate_length(:posts, is: 1) |> unique_constraint(:slug, name: :index_topics_on_forum_id_and_slug) end