]> projects.mako.cc - selectricity/blobdiff - app/models/voter.rb
Variety of small changes (mostly to properties) plus a few "in the
[selectricity] / app / models / voter.rb
old mode 100644 (file)
new mode 100755 (executable)
index 7139b89..f229909
@@ -2,7 +2,14 @@ class Voter < ActiveRecord::Base
   belongs_to :election
   has_one :vote
 
   belongs_to :election
   has_one :vote
 
+  def destroy
+    vote.destroy if vote
+    super
+  end
+
+  def voted?
+    vote.confirmed == 1
+  end
 end
 
 
 end
 
 
-

Benjamin Mako Hill || Want to submit a patch?