removed blank columns

This commit is contained in:
Harry Bomrah 2016-01-12 20:32:40 +08:00
parent 299875a130
commit be3945cd44
1 changed files with 11 additions and 4 deletions

View File

@ -47,12 +47,19 @@ class Honor
"awarding_unit"
]
pd_title = fields_to_show.collect do |t|
{
"plugin_data_title" => I18n.t("personal_honor.#{t}")
}
fields_to_remove = []
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)
pd_title << {
"plugin_data_title" => I18n.t("personal_honor.#{t}")
} if !fields_to_remove.include?(t)
end
fields_to_show = fields_to_show - fields_to_remove
plugin_datas = datas.sort_for_frontend.collect.with_index do |p,index|
pd_data = []