From 165714f74676269c22282e7182746e2e2e6204f7 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Mon, 6 Mar 2017 21:10:07 +0800 Subject: [PATCH] small fix for duration --- app/models/diploma.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/models/diploma.rb b/app/models/diploma.rb index 787cc8d..d7c7b84 100644 --- a/app/models/diploma.rb +++ b/app/models/diploma.rb @@ -60,6 +60,8 @@ class Diploma 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