From: Date: Fri, 9 May 2008 20:56:16 +0000 (-0400) Subject: Added a check to make sure a voter has a valid email address before attempting ot... X-Git-Url: https://projects.mako.cc/source/selectricity/commitdiff_plain/f8ebf16c9444c239928d730d1f84275b90d733e6?hp=5aba48adb5fc188efeddc38675abd5e1e3a88844 Added a check to make sure a voter has a valid email address before attempting ot e-mail them. --- diff --git a/app/controllers/election_controller.rb b/app/controllers/election_controller.rb index 94c203d..6faaf22 100644 --- a/app/controllers/election_controller.rb +++ b/app/controllers/election_controller.rb @@ -80,9 +80,10 @@ class ElectionController < ApplicationController def start_election @election = Election.find(params[:id]) + @election.voters.each do |voter| voter.vote = Vote.new - email_voter voter + email_voter voter unless voter.email.nil? end @election.activate!