X-Git-Url: https://projects.mako.cc/source/selectricity-live/blobdiff_plain/73f1c8f028bb366d3d8d982084fa777181bce5b5..7f9b2e3a2c78d72e72247f97cdba82fb71846aae:/app/models/selectricity_service.rb diff --git a/app/models/selectricity_service.rb b/app/models/selectricity_service.rb index da58f71..b288cc3 100644 --- a/app/models/selectricity_service.rb +++ b/app/models/selectricity_service.rb @@ -79,8 +79,12 @@ class SelectricityService < ActionWebService::Base def list_quickvotes() all=Array.new QuickVote.find_all.each do |election| - all << ElectionStruct.new (:id => election.id, :name => election.name, :description => election.description) + all << get_quickvote(election.name) end return all end + def get_quickvote(shortname) + return ElectionStruct.new unless election=QuickVote.ident_to_quickvote(shortname) + return ElectionStruct.new (:id => election.id, :name => election.name, :description => election.description, :candidates => election.candidates.collect {|c| c.id } ) + end end