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