Commit 8a5752dd authored by Benjamin Neff's avatar Benjamin Neff

Fix creating a post with poll

There were validation errors because `answer.poll` wasn't set.
parent c3823219
......@@ -36,7 +36,8 @@ class StatusMessageCreationService
if params[:poll_question].present?
status_message.build_poll(question: params[:poll_question])
[*params[:poll_answers]].each do |poll_answer|
status_message.poll.poll_answers.build(answer: poll_answer)
answer = status_message.poll.poll_answers.build(answer: poll_answer)
answer.poll = status_message.poll
end
end
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment