From 1d006ce806c4235f9fb48f43db6a2b3004bd7a2b Mon Sep 17 00:00:00 2001 From: gebele Date: Fri, 5 Oct 2018 13:20:37 +0000 Subject: fixed mazzatorta warnings in single predictions --- application.rb | 2 +- views/prediction.haml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/application.rb b/application.rb index e6ca7c2..650f9a1 100644 --- a/application.rb +++ b/application.rb @@ -557,7 +557,7 @@ post '/predict/?' do if prediction["value"] output["mazzatorta"] = {:mmol_prediction => @compound.mg_to_mmol(prediction["value"].delog10p).signif(3),:prediction => prediction["value"].delog10p.signif(3)} else - output["mazzatorta"] << {:warnings => prediction["warnings"][0].split("\t").first} + output["mazzatorta"] = {:warnings => prediction["warnings"][0].split("\t").first} end @predictions << output else diff --git a/views/prediction.haml b/views/prediction.haml index 152efc9..076ed64 100644 --- a/views/prediction.haml +++ b/views/prediction.haml @@ -159,7 +159,7 @@ %b.title Lowest observed adverse effect level (LOAEL) (Rats) (Mazzatorta) %p - hash = mazzatorta["mazzatorta"] - - unless hash.keys.include?("warnings") + - unless hash.keys.include?("warnings") || hash.key?(:warnings) %b Prediction: %br = "#{hash[:mmol_prediction]} (mmol/kg_bw/day)" -- cgit v1.2.3