From 133c94ce531e1c623dbe9c5f2eb05307357b35f2 Mon Sep 17 00:00:00 2001 From: John Dong Date: Thu, 16 Aug 2007 20:21:43 -0400 Subject: [PATCH] Throw an ArgumentError if invalid election name is passed to casting --- app/models/selectricity_service.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/models/selectricity_service.rb b/app/models/selectricity_service.rb index 4075f64..7da46e1 100644 --- a/app/models/selectricity_service.rb +++ b/app/models/selectricity_service.rb @@ -21,6 +21,8 @@ class SelectricityService < ActionWebService::Base voter.save! voter.vote.confirm! voter.save! + else + raise ArgumentError.new "Cannot find election #{election_name}" end end def quickvote_candidate_ids_to_names(shortname, id_list) -- 2.39.5