Fix creating a post with poll
There were validation errors because `answer.poll` wasn't set.
This commit is contained in:
parent
c382321934
commit
8a5752dd6c
1 changed files with 2 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue