Use option instead of answer when sampling question options

We were still assigning answer: question.question_options.sample.title,
which made sense before we introduced the option association.
This commit is contained in:
taitus
2025-10-13 13:41:53 +02:00
parent b3f8ba819b
commit 9ff167d040

View File

@@ -158,9 +158,11 @@ section "Creating Poll Voters" do
poll.questions.each do |question|
next unless [true, false].sample
option = question.question_options.sample
Poll::Answer.create!(question_id: question.id,
author: user,
answer: question.question_options.sample.title)
option: option,
answer: option.title)
end
end