From f8ebf16c9444c239928d730d1f84275b90d733e6 Mon Sep 17 00:00:00 2001 From: Date: Fri, 9 May 2008 16:56:16 -0400 Subject: [PATCH] Added a check to make sure a voter has a valid email address before attempting ot e-mail them. --- app/controllers/election_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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! -- 2.30.2