From f2a27c6b407e56cc44570520f650d81fa61808f7 Mon Sep 17 00:00:00 2001 From: saurabhbhatia Date: Mon, 23 Sep 2013 09:52:33 +0800 Subject: [PATCH] Updated Import method in teachers to make all false positives. --- .../admin/import_data_controller.rb | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/app/controllers/admin/import_data_controller.rb b/app/controllers/admin/import_data_controller.rb index c4f25da1f..7e3425c9d 100644 --- a/app/controllers/admin/import_data_controller.rb +++ b/app/controllers/admin/import_data_controller.rb @@ -22,20 +22,21 @@ class Admin::ImportDataController < OrbitBackendController @roles = Role.all @teacher = User.new I18n.locale = :zh_tw - if hash['teacher_zh_tw'].blank? && hash['teacher_en'].blank? - @teacher.first_name = "Please Fill the Name" + if !hash['teacher_zh_tw'].blank? + @teacher.first_name = hash['teacher_zh_tw'] elsif hash['teacher_zh_tw'].blank? && !hash['teacher_en'].blank? @teacher.first_name = hash['teacher_en'] - else - @teacher.first_name = hash['teacher_zh_tw'] - end - I18n.locale = :en - if hash['teacher_zh_tw'].blank? && hash['teacher_en'].blank? + elsif hash['teacher_zh_tw'].blank? && hash['teacher_en'].blank? @teacher.first_name = "Please Fill the Name" + end + + I18n.locale = :en + if !hash['teacher_en'].blank? + @teacher.first_name = hash['teacher_en'] elsif hash['teacher_en'].blank? && !hash['teacher_zh_tw'].blank? @teacher.first_name = hash['teacher_zh_tw'] - elsif !hash['teacher_en'].blank? && hash['teacher_zh_tw'].blank? - @teacher.first_name = hash['teacher_en'] + elsif hash['teacher_en'].blank? && hash['teacher_zh_tw'].blank? + @teacher.first_name = "Please Fill the Name" end #@teacher.first_name = hash['teacher_en']