From 2b8fb35f5a3c32f87268822566a7ad5128636242 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Fri, 25 Oct 2019 09:13:28 +0800 Subject: [PATCH] competition: fix bug --- app/models/competition.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/competition.rb b/app/models/competition.rb index 845c5c00f..332ed09e5 100644 --- a/app/models/competition.rb +++ b/app/models/competition.rb @@ -85,7 +85,7 @@ class Competition < ApplicationRecord # 是否开放 def open?(user) user_school_id = user.user_extension&.school_id.to_i - competition.region_schools.size == 0 || competition.region_schools.exists?(school_id: user_school_id) + region_schools.size == 0 || region_schools.exists?(school_id: user_school_id) end # 是否禁止教师报名