Getting at least one tournament working!

This commit is contained in:
Dan Buch
2012-03-12 00:18:42 -04:00
parent 73cff897a3
commit d08362326d
10 changed files with 66 additions and 79 deletions

View File

@@ -82,14 +82,14 @@ class MashTournamentBuilder
previous_winners = previous.mashes.collect(&:winner_id)
pool = @map_model.all(
:order => 'RANDOM()',
:conditions => ['id in ?', previous_winners]
:conditions => {:id => previous_winners}
)
filled_in = []
round.mashes.each do |mash|
mash.map_a = pool.pop.id
mash.map_b = pool.pop.id
mash.map_a = pool.pop
mash.map_b = pool.pop
mash.save!
filled_in << mash