Merge pull request #20 from turniere/feature/db_testdata
Save Matches and Stages
This commit is contained in:
commit
6b7aecaed4
|
|
@ -7,7 +7,7 @@ tournament = user.tournaments.create! name: Faker::Dog.name
|
||||||
|
|
||||||
@teams = []
|
@teams = []
|
||||||
16.times do
|
16.times do
|
||||||
team = tournament.teams.create name: Faker::HarryPotter.character
|
team = tournament.teams.create! name: Faker::HarryPotter.character
|
||||||
@teams << team
|
@teams << team
|
||||||
end
|
end
|
||||||
4.times do |i|
|
4.times do |i|
|
||||||
|
|
@ -20,5 +20,7 @@ end
|
||||||
match.match_scores.create! team: @teams.sample, points: rand(10)
|
match.match_scores.create! team: @teams.sample, points: rand(10)
|
||||||
match.position = j
|
match.position = j
|
||||||
match.state = rand(7)
|
match.state = rand(7)
|
||||||
|
match.save!
|
||||||
end
|
end
|
||||||
|
stage.save!
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue