From: John Dong Date: Fri, 17 Aug 2007 00:21:43 +0000 (-0400) Subject: Throw an ArgumentError if invalid election name is passed to casting X-Git-Url: https://projects.mako.cc/source/selectricity/commitdiff_plain/133c94ce531e1c623dbe9c5f2eb05307357b35f2 Throw an ArgumentError if invalid election name is passed to casting --- 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)