small fix for duration

This commit is contained in:
Harry Bomrah 2017-12-22 15:56:15 +08:00
parent 3c047cd90c
commit 67f3447113
1 changed files with 2 additions and 0 deletions

View File

@ -56,6 +56,8 @@ class Experience
fields_to_show.each do |t| fields_to_show.each do |t|
if (self.fields[t].type.to_s == "String" || self.fields[t].type.to_s == "Object" rescue false) if (self.fields[t].type.to_s == "String" || self.fields[t].type.to_s == "Object" rescue false)
fields_to_remove << t if (datas.where(t.to_sym.ne => nil, t.to_sym.ne => "").count == 0 rescue false) fields_to_remove << t if (datas.where(t.to_sym.ne => nil, t.to_sym.ne => "").count == 0 rescue false)
elsif t == "duration"
fields_to_remove << t if (datas.where(:start_date.ne => nil).count == 0 rescue false)
else else
fields_to_remove << t if (datas.where(t.to_sym.ne => nil).count == 0 rescue false) fields_to_remove << t if (datas.where(t.to_sym.ne => nil).count == 0 rescue false)
end end