]> projects.mako.cc - selectricity/blobdiff - app/models/raw_voter_list.rb
updated top the the new version of attachment_fu plugin to work out some
[selectricity] / app / models / raw_voter_list.rb
index 2f7cb28b1ae62f2ca6ec46c56d2fb8eecf07bbe5..64530d72b131f684c37205a3abe32cef4453ede1 100644 (file)
@@ -1,3 +1,10 @@
+# Selectricity: Voting Machinery for the Masses
+# Copyright (C) 2007, 2008 Benjamin Mako Hill <mako@atdot.cc>
+# Copyright (C) 2007 Massachusetts Institute of Technology
+#
+# This program is free software. Please see the COPYING file for
+# details.
+
 class RawVoterList
 
   attr_accessor :email
 class RawVoterList
 
   attr_accessor :email
@@ -6,7 +13,7 @@ class RawVoterList
   include Enumerable
 
   def initialize(params={})
   include Enumerable
 
   def initialize(params={})
-    @email = params[:email] || 1
+    @email = params[:email].to_i || 1
     @input_addresses = params[:input_addresses] || String.new
   end
 
     @input_addresses = params[:input_addresses] || String.new
   end
 
@@ -16,7 +23,7 @@ class RawVoterList
   
   def each
     @input_addresses.split("\n").each do |address|
   
   def each
     @input_addresses.split("\n").each do |address|
-      yield Voter.new( { :email => address } ) 
+      yield FullVoter.new( { :email => address } ) 
     end
   end
 end
     end
   end
 end

Benjamin Mako Hill || Want to submit a patch?