mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-03 21:33:48 +00:00
Cut the runtime by queueing the changes in memory and deferring database writes
Made some unspecified behavior explicit
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
class Pool
|
||||
def initialize(weight)
|
||||
@weight = weight
|
||||
@tournament = @weight.tournament
|
||||
@pool = 1
|
||||
end
|
||||
|
||||
@@ -23,7 +24,7 @@ class Pool
|
||||
bouts = b.map
|
||||
bouts.each do |bout|
|
||||
if bout[0] != nil and bout[1] != nil
|
||||
match = Match.new(
|
||||
match = @tournament.matches.create(
|
||||
w1: bout[0].id,
|
||||
w2: bout[1].id,
|
||||
weight_id: @weight.id,
|
||||
|
||||
Reference in New Issue
Block a user