]> projects.mako.cc - selectricity-live/blobdiff - app/models/voter.rb
blanked readme file and created a list of contributors inside
[selectricity-live] / app / models / voter.rb
old mode 100644 (file)
new mode 100755 (executable)
index a63ec67..f229909
@@ -1,3 +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?