From 09abc5511fbb574cf8d0947592a8bbac8c520ef5 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Tue, 30 Apr 2019 14:53:26 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E7=BC=96=E8=BE=91=E9=83=A8=E9=97=A8url?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/managements_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb index 53eb23ae..d4e08240 100644 --- a/app/controllers/managements_controller.rb +++ b/app/controllers/managements_controller.rb @@ -1416,7 +1416,8 @@ end def update_depart_identifier if params[:depart] && params[:identifier] @department = Department.where(:id => params[:depart]).first - @department.update_attributes(:identifier => params[:identifier]) if @department.present? + identifier = params[:identifier].strip.blank? ? nil : params[:identifier].strip + @department.update_attributes(:identifier => identifier) if @department.present? end end From cb8b80efe9d9da2ced8cd07fa5b953e05e06a3c7 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Tue, 30 Apr 2019 14:56:34 +0800 Subject: [PATCH 2/3] gem --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index f4697bf5..7dca07cd 100644 --- a/Gemfile +++ b/Gemfile @@ -63,7 +63,7 @@ gem 'elasticsearch-rails' gem 'oauth2' # xlsx -gem 'axlsx_rails', '0.3.0' +# gem 'axlsx_rails', '0.3.0' #Ruby 2.2+ has removed test/unit from the core library. if RUBY_VERSION>='2.2' 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 3/3] =?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