end
def confirm!
- self.confirmed = 1
- self.time = Time.now
- self.save
-
- unless self.voter.election.quickvote?
- token.destroy and token.reload if token
- self.token = Token.new
+ if self.voter.election.candidates.length == self.rankings.length
+ self.confirmed = 1
+ self.time = Time.now
self.save
+
+ unless self.voter.election.quickvote?
+ token.destroy and token.reload if token
+ self.token = Token.new
+ self.save
+ end
+ return false
+ else
+ return true
end
end