X-Git-Url: https://projects.mako.cc/source/selectricity/blobdiff_plain/49bc919b9f7edd189a311cdb910ab0a7500030ac..7f9b2e3a2c78d72e72247f97cdba82fb71846aae:/app/models/selectricity_service.rb diff --git a/app/models/selectricity_service.rb b/app/models/selectricity_service.rb index e130375..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, :candidates => election.candidates.collect {|c| c.id } ) + 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