]> projects.mako.cc - selectricity-live/blobdiff - app/models/voter.rb
Big commit includes:
[selectricity-live] / app / models / voter.rb
index 7139b899a725fd6b32de66393f7decc58a5d99c8..f229909814c12fbd51beeb120061661ef87a67ec 100644 (file)
@@ -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?