From 67f3447113f42af05c5c3dbf84a26c268df2e816 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Fri, 22 Dec 2017 15:56:15 +0800 Subject: [PATCH] small fix for duration --- app/models/experience.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/models/experience.rb b/app/models/experience.rb index 2579385..0c3460e 100644 --- a/app/models/experience.rb +++ b/app/models/experience.rb @@ -56,6 +56,8 @@ class Experience fields_to_show.each do |t| 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) + elsif t == "duration" + fields_to_remove << t if (datas.where(:start_date.ne => nil).count == 0 rescue false) else fields_to_remove << t if (datas.where(t.to_sym.ne => nil).count == 0 rescue false) end