1
0
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:
RJ Osborne
2015-05-24 23:04:22 -04:00
parent 98879c16b9
commit 091b7c4181
5 changed files with 24 additions and 16 deletions

View File

@@ -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,