Fixes dev seeds

Poll::Questions now have a validation for a `poll_id`
This commit is contained in:
rgarcia
2017-09-19 19:39:47 +02:00
parent f99612d619
commit 37be890fbe

View File

@@ -585,7 +585,7 @@ print "Creating Poll Questions from Proposals"
3.times do
proposal = Proposal.reorder("RANDOM()").first
poll = Poll.current.first
question = Poll::Question.create(valid_answers: "Yes, No")
question = Poll::Question.create(valid_answers: "Yes, No", poll: poll)
question.copy_attributes_from_proposal(proposal)
question.save!
end
@@ -596,7 +596,7 @@ print "Creating Successful Proposals"
10.times do
proposal = Proposal.reorder("RANDOM()").first
poll = Poll.current.first
question = Poll::Question.create(valid_answers: "Yes, No")
question = Poll::Question.create(valid_answers: "Yes, No", poll: poll)
question.copy_attributes_from_proposal(proposal)
question.save!
end