Updated Import method in teachers to make all false positives.

This commit is contained in:
saurabhbhatia 2013-09-23 09:52:33 +08:00
parent 9613a52305
commit f2a27c6b40
1 changed files with 10 additions and 9 deletions

View File

@ -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']