From 7a5499a62229078020da5c6e068caa6c836790d0 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 10 Sep 2019 09:30:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=BC=E5=87=BA=E6=88=90=E7=BB=A9=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E6=8C=87=E5=AF=BC=E8=80=81=E5=B8=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/competition_team.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/competition_team.rb b/app/models/competition_team.rb index e2551710..7b0e6d50 100644 --- a/app/models/competition_team.rb +++ b/app/models/competition_team.rb @@ -11,7 +11,8 @@ class CompetitionTeam < ActiveRecord::Base # attr_accessible :invite_code, :name, :team_type def teacher - User.where(:id => self.teacher_id).first + teacher_id = self.teachers.first&.user_id + User.find_by(id: teacher_id) end def group_members