From 039e0250ad48efdd85d81d8fa1834a5381a27b1c Mon Sep 17 00:00:00 2001 From: John Britton Date: Wed, 16 Feb 2011 03:56:24 -0500 Subject: [PATCH] only include eligible votes in the drawing --- app.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.rb b/app.rb index 97e55f7..fc9120a 100644 --- a/app.rb +++ b/app.rb @@ -113,7 +113,7 @@ class Vote builder :host end - votes.keep_if {|vote| vote.eligible} + votes = votes.all(:eligible => true) @winning_vote = votes[rand(votes.count)] @winning_vote.eligible = false @winning_vote.save