list_quickvotes XMLRPC returns candidate ID's instead of names
authorJohn Dong <jdong@mit.edu>
Thu, 16 Aug 2007 23:33:49 +0000 (19:33 -0400)
committerJohn Dong <jdong@mit.edu>
Thu, 16 Aug 2007 23:33:49 +0000 (19:33 -0400)
app/apis/selectricity_api.rb
app/models/selectricity_service.rb

index 70e647983f8987e6fe58631e70e4f0180c57d3a9..af75cf67d28f60db7e366a8c503fb39f859f0170 100644 (file)
@@ -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
index da58f71a0aa59ee3a0a31ff2f208b787e20dd55d..e13037535bf04b37e290244feff0c21b597ee458 100644 (file)
@@ -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

Benjamin Mako Hill || Want to submit a patch?