From c28692ffc5cc924f29d6b559665824d1193d8e06 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Tue, 30 Apr 2019 15:01:50 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/school.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/school.rb b/app/models/school.rb index 081f3c0c..fd925f9a 100644 --- a/app/models/school.rb +++ b/app/models/school.rb @@ -64,7 +64,7 @@ class School < ActiveRecord::Base def statistic_url dep = departments.where("identifier is not null").first - url = dep.present? ? "/colleges/#{dep.identifier}/statistics" : "/colleges/#{self.id}/statistics" + url = dep.present? && !dep.identifier.blank? ? "/colleges/#{dep.identifier}/statistics" : "/colleges/#{self.id}/statistics" end def course_act_time