Skip to content

Commit

Permalink
Fix MFA usage in cast_assoc (#267)
Browse files Browse the repository at this point in the history
  • Loading branch information
liamwhite authored Jun 2, 2024
1 parent 80f9fa9 commit e6c7651
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/philomena/conversations/conversation.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion lib/philomena/topics/topic.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e6c7651

Please sign in to comment.