From 9ff167d040393d73c86445400c137dff4b18e8e2 Mon Sep 17 00:00:00 2001 From: taitus Date: Mon, 13 Oct 2025 13:41:53 +0200 Subject: [PATCH] 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. --- db/dev_seeds/polls.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/db/dev_seeds/polls.rb b/db/dev_seeds/polls.rb index 78403006e..1d5e25077 100644 --- a/db/dev_seeds/polls.rb +++ b/db/dev_seeds/polls.rb @@ -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