Fix voters on booth not being created in dev seeds
There were validation errors because they didn't have officer nor booth assignments.
This commit is contained in:
@@ -114,12 +114,16 @@ end
|
|||||||
section "Creating Poll Voters" do
|
section "Creating Poll Voters" do
|
||||||
|
|
||||||
def vote_poll_on_booth(user, poll)
|
def vote_poll_on_booth(user, poll)
|
||||||
|
officer = Poll::Officer.all.sample
|
||||||
|
|
||||||
Poll::Voter.create!(document_type: user.document_type,
|
Poll::Voter.create!(document_type: user.document_type,
|
||||||
document_number: user.document_number,
|
document_number: user.document_number,
|
||||||
user: user,
|
user: user,
|
||||||
poll: poll,
|
poll: poll,
|
||||||
origin: "booth",
|
origin: "booth",
|
||||||
officer: Poll::Officer.all.sample)
|
officer: officer,
|
||||||
|
officer_assignment: officer.officer_assignments.sample,
|
||||||
|
booth_assignment: poll.booth_assignments.sample)
|
||||||
end
|
end
|
||||||
|
|
||||||
def vote_poll_on_web(user, poll)
|
def vote_poll_on_web(user, poll)
|
||||||
|
|||||||
Reference in New Issue
Block a user