From 90a487acf9fdaadb3e6fff1655036229cbd1f6e3 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Thu, 24 Oct 2019 10:29:50 +0800 Subject: [PATCH] competition: fix enroll api error --- app/services/competitions/create_personal_team_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/competitions/create_personal_team_service.rb b/app/services/competitions/create_personal_team_service.rb index 7f2123ce7..907c59dc0 100644 --- a/app/services/competitions/create_personal_team_service.rb +++ b/app/services/competitions/create_personal_team_service.rb @@ -21,7 +21,7 @@ class Competitions::CreatePersonalTeamService < ApplicationService ActiveRecord::Base.transaction do team = competition.competition_teams.create!(name: user.real_name, user_id: user.id) - team.team_members.create!(competition_id: competition, user_id: user.id, role: 1, is_teacher: is_teacher) + team.team_members.create!(competition_id: competition.id, user_id: user.id, role: 1, is_teacher: is_teacher) end end end \ No newline at end of file