Changed properties to remove unecessary exectables.
[selectricity-live] / app / models / quick_vote.rb
index 1df25afb74d1273bcbc2d4d64c58e718187f2ddf..8d4e6e82141f8b8c67dab67d0103c170a97f0324 100644 (file)
@@ -16,18 +16,13 @@ class QuickVote < Election
   
   def initialize(params={})
     super
-    self.enddate =  Time.now + 30
+    self.enddate =  Time.now + 30.days
     self.active = 1
     self.anonymous = 1
-    self.quickvote = 1
   end
 
-  def candidatelist=(candstring='')
-    @raw_candidates = candstring.split(';').collect {|cand| cand.strip }
-  end
-
-  def candidatelist
-    @raw_candidates.join("; ")
+  def candidatelist=(candlist)
+    @raw_candidates = candlist
   end
 
   def name
@@ -41,7 +36,6 @@ class QuickVote < Election
   def create_candidates
     @raw_candidates.each do |name|
       candidate = Candidate.new({:name => name})
-      candidate.save
       self.candidates << candidate
     end
   end

Benjamin Mako Hill || Want to submit a patch?