voter.save!
voter.vote.confirm!
voter.save!
+ else
+ raise ArgumentError.new "Cannot find election #{election_name}"
end
end
def quickvote_candidate_ids_to_names(shortname, id_list)
return result
end
qv.votes.each do |vote|
- votes << VoteInfo.new(:voter_id => vote.voter.id, :voter_ipaddress => vote.voter.ipaddress, :vote_time => vote.time.to_i)
+ votes << VoteInfo.new(:voter_id => vote.voter.id, :voter_ipaddress => vote.voter.ipaddress, :vote_time => vote.time.to_i, :vote => vote.votes)
end
return votes
end
def create_quickvote(election)
qv=QuickVote.new(:name => election.name, :description => election.description)
qv.candidatelist=election.candidate_names
- return qv.save.to_s
+ if qv.save
+ return ""
+ else
+ return "Saving quickvote FAILED:"+qv.errors.inspect
+ end
end
end