|
|
@ -25,6 +25,8 @@ namespace :competition do
|
|
|
|
|
|
|
|
|
|
|
|
users = User.joins(:user_extension).where(id: user_ids).where(user_extensions: {identity: 0})
|
|
|
|
users = User.joins(:user_extension).where(id: user_ids).where(user_extensions: {identity: 0})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
competition.competition_teams.destroy_all
|
|
|
|
|
|
|
|
|
|
|
|
users.each do |user|
|
|
|
|
users.each do |user|
|
|
|
|
team = CompetitionTeam.create!(competition_id: competition.id, user_id: user.id, name: user.real_name)
|
|
|
|
team = CompetitionTeam.create!(competition_id: competition.id, user_id: user.id, name: user.real_name)
|
|
|
|
TeamMember.create!(competition_team_id: team.id, user_id: user.id, role: 1, competition_id: competition.id)
|
|
|
|
TeamMember.create!(competition_team_id: team.id, user_id: user.id, role: 1, competition_id: competition.id)
|
|
|
|