]> projects.mako.cc - selectricity-live/blobdiff - app/models/voter.rb
Changed the README to include Justin's name.
[selectricity-live] / app / models / voter.rb
old mode 100644 (file)
new mode 100755 (executable)
index 13b43f5..f229909
@@ -1,4 +1,15 @@
 class Voter < ActiveRecord::Base
   belongs_to :election
   has_one :vote
+
+  def destroy
+    vote.destroy if vote
+    super
+  end
+
+  def voted?
+    vote.confirmed == 1
+  end
 end
+
+

Benjamin Mako Hill || Want to submit a patch?