From 40d4b889fd3356ce4009ce2b5f651b237749488e Mon Sep 17 00:00:00 2001 From: Bohung Date: Mon, 7 Feb 2022 17:28:23 +0800 Subject: [PATCH] Fix bug. --- app/controllers/admin/cancerpredicts_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/admin/cancerpredicts_controller.rb b/app/controllers/admin/cancerpredicts_controller.rb index 324f6f3..6c086d9 100644 --- a/app/controllers/admin/cancerpredicts_controller.rb +++ b/app/controllers/admin/cancerpredicts_controller.rb @@ -97,7 +97,7 @@ class Admin::CancerpredictsController < OrbitAdminController @form_to_show.form_show[ num.to_s ][ sub_property ][params[:locale].to_s] = [] end end - if(property["old_num"] != nil && property["old_num"] != num.to_s) + if(property["old_num"].present? && property["old_num"] != num.to_s) other_in_use_locales.each do |locale| @form_to_show.form_show[ num.to_s ][ sub_property ][locale] = @form_to_show.form_show_was[ property["old_num"] ][ sub_property ][locale] end @@ -185,7 +185,7 @@ class Admin::CancerpredictsController < OrbitAdminController @form_to_show.form_show_in_result[ num.to_s ][ sub_property ][params[:locale].to_s] = [] end end - if(property["old_num"] != nil && property["old_num"] != num.to_s) + if(property["old_num"].present? && property["old_num"] != num.to_s) other_in_use_locales.each do |locale| @form_to_show.form_show_in_result[ num.to_s ][ sub_property ][locale] = @form_to_show.form_show_was[ property["old_num"] ][ sub_property ][locale] end