From fcf32474b604915d2e1f7313bd42026f326260d9 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 8 Jul 2016 13:53:54 +0800 Subject: [PATCH] modified days and hours for nil data --- app/views/quality_analysis/_show.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/quality_analysis/_show.html.erb b/app/views/quality_analysis/_show.html.erb index 0b16a1adb..3adea5c72 100644 --- a/app/views/quality_analysis/_show.html.erb +++ b/app/views/quality_analysis/_show.html.erb @@ -45,11 +45,11 @@
技术债务 - <% if @complexity["msr"][8].nil? %> + <% if @complexity["msr"][8].nil? || @complexity["msr"][8]["frmt_val"] == "0" %> 0 <% else %> <%= /[0-9]*/.match(@complexity["msr"][8]["frmt_val"])[0] %>天 - <%= / [0-9]*/.match(@complexity["msr"][8]["frmt_val"]) %>小时 + <%= / [0-9]*/.match(@complexity["msr"][8]["frmt_val"]).nil? ? 0 : / [0-9]*/.match(@complexity["msr"][8]["frmt_val"]) %>小时 <% end %> 查看详情