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 @roles = Role.all
@teacher = User.new @teacher = User.new
I18n.locale = :zh_tw I18n.locale = :zh_tw
if hash['teacher_zh_tw'].blank? && hash['teacher_en'].blank? if !hash['teacher_zh_tw'].blank?
@teacher.first_name = "Please Fill the Name" @teacher.first_name = hash['teacher_zh_tw']
elsif hash['teacher_zh_tw'].blank? && !hash['teacher_en'].blank? elsif hash['teacher_zh_tw'].blank? && !hash['teacher_en'].blank?
@teacher.first_name = hash['teacher_en'] @teacher.first_name = hash['teacher_en']
else elsif hash['teacher_zh_tw'].blank? && hash['teacher_en'].blank?
@teacher.first_name = hash['teacher_zh_tw']
end
I18n.locale = :en
if hash['teacher_zh_tw'].blank? && hash['teacher_en'].blank?
@teacher.first_name = "Please Fill the Name" @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? elsif hash['teacher_en'].blank? && !hash['teacher_zh_tw'].blank?
@teacher.first_name = hash['teacher_zh_tw'] @teacher.first_name = hash['teacher_zh_tw']
elsif !hash['teacher_en'].blank? && hash['teacher_zh_tw'].blank? elsif hash['teacher_en'].blank? && hash['teacher_zh_tw'].blank?
@teacher.first_name = hash['teacher_en'] @teacher.first_name = "Please Fill the Name"
end end
#@teacher.first_name = hash['teacher_en'] #@teacher.first_name = hash['teacher_en']