merged in changes from live version
[selectricity-live] / app / models / election.rb
index 7d8ad80d883ee45ab6bee1a875ed446478d68151..9ce89b9b6baae86009ebc4b7ebdaef096e4dd970 100644 (file)
@@ -73,7 +73,7 @@ class Election < ActiveRecord::Base
       reasons << "You must have at least two candidates."
     end
     
-    if self.voters.length <= 1
+    if self.voters.length <= 1 and self.authenticated?
       reasons << "You must have at least two voters."
     end
 
@@ -86,7 +86,7 @@ class Election < ActiveRecord::Base
   end
   
   def quickvote?
-    self.class == 'QuickVote'
+    self.class == QuickVote
   end
 
   def active?
@@ -97,6 +97,10 @@ class Election < ActiveRecord::Base
     active == 2
   end
 
+  def authenticated?
+    authenticated
+  end
+  
   def shortdesc
     shortdesc = description.split(/\n/)[0]
   end

Benjamin Mako Hill || Want to submit a patch?