X-Git-Url: https://projects.mako.cc/source/selectricity-live/blobdiff_plain/22a46a7e2d408fa64e55abd839e6b448f73ed760..e2d5b6e7b4f5ed6fb0cbec01df80bd50a6796950:/app/models/full_voter.rb?ds=sidebyside diff --git a/app/models/full_voter.rb b/app/models/full_voter.rb index b82667c..1806237 100644 --- a/app/models/full_voter.rb +++ b/app/models/full_voter.rb @@ -1,7 +1,29 @@ +# Selectricity: Voting Machinery for the Masses +# Copyright (C) 2007, 2008 Benjamin Mako Hill +# Copyright (C) 2007 Massachusetts Institute of Technology +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public +# License along with this program. If not, see +# . + class FullVoter < Voter - before_create :create_password validates_presence_of :email, :password + def initialize(params={}) + super + create_password + end + def create_password token_generator = UniqueTokenGenerator.new( 16 ) until password and not password.empty? \