X-Git-Url: https://projects.mako.cc/source/selectricity-live/blobdiff_plain/133c94ce531e1c623dbe9c5f2eb05307357b35f2..6df3d73c4a0c52d79f3e8abe5180fbd73953a6a5:/app/models/selectricity_service.rb?ds=sidebyside diff --git a/app/models/selectricity_service.rb b/app/models/selectricity_service.rb index 7da46e1..9e276ef 100644 --- a/app/models/selectricity_service.rb +++ b/app/models/selectricity_service.rb @@ -80,7 +80,7 @@ class SelectricityService < ActionWebService::Base 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 @@ -98,7 +98,11 @@ class SelectricityService < ActionWebService::Base 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