- #Calculate Election Results
- def results
- # initalize the tallies to empty arrays
- preference_tally = Array.new
- plurality_tally = Array.new
- approval_tally = Array.new
-
- self.voters.each do |voter|
- # skip if the voter has not voted or has an unconfirmed vote
- next unless voter.voted?
+ def create_candidates
+ return unless errors.empty?
+
+ # delete the candidates
+ candidates.each {|c| c.destroy}