From d53dce6adc83e3dcd7f712c5174d856beb73c522 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Wed, 13 Jan 2016 18:48:17 +0800 Subject: [PATCH] field object type --- app/models/experience.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/models/experience.rb b/app/models/experience.rb index c6e6e3f..2df3598 100644 --- a/app/models/experience.rb +++ b/app/models/experience.rb @@ -54,7 +54,11 @@ class Experience pd_title = [] fields_to_show.each do |t| - fields_to_remove << t if (datas.where(t.to_sym.ne => nil, t.to_sym.ne => "").count == 0 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) + else + fields_to_remove << t if (datas.where(t.to_sym.ne => nil).count == 0 rescue false) + end pd_title << { "plugin_data_title" => I18n.t("personal_experience.#{t}") } if !fields_to_remove.include?(t)