From 49bc919b9f7edd189a311cdb910ab0a7500030ac Mon Sep 17 00:00:00 2001 From: John Dong Date: Thu, 16 Aug 2007 19:33:49 -0400 Subject: [PATCH] list_quickvotes XMLRPC returns candidate ID's instead of names --- app/apis/selectricity_api.rb | 1 + app/models/selectricity_service.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/apis/selectricity_api.rb b/app/apis/selectricity_api.rb index 70e6479..af75cf6 100644 --- a/app/apis/selectricity_api.rb +++ b/app/apis/selectricity_api.rb @@ -1,6 +1,7 @@ class ElectionStruct < ActionWebService::Struct member :name, :string member :description, :string + member :candidates, [:int] member :id, :int end class VoteInfo < ActionWebService::Struct diff --git a/app/models/selectricity_service.rb b/app/models/selectricity_service.rb index da58f71..e130375 100644 --- a/app/models/selectricity_service.rb +++ b/app/models/selectricity_service.rb @@ -79,7 +79,7 @@ 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 << ElectionStruct.new (:id => election.id, :name => election.name, :description => election.description, :candidates => election.candidates.collect {|c| c.id } ) end return all end -- 2.39.5