Skip to content

Commit

Permalink
only include eligible votes in the drawing
Browse files Browse the repository at this point in the history
  • Loading branch information
johndbritton committed Feb 16, 2011
1 parent 587b426 commit 039e025
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app.rb
Expand Up @@ -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
Expand Down

0 comments on commit 039e025

Please sign in to comment.