1
0

Unknown formula values default to nil

This commit is contained in:
cryptogopher 2019-11-09 22:35:29 +01:00
parent 67b0cd9b66
commit eba2aaa8aa

View File

@ -104,9 +104,7 @@ class Ingredient < ActiveRecord::Base
[
i,
input_q.map do |i_q|
# FIXME: result for computation with nil values (substituted with 0s)
# should be marked as not precise
nutrient_data = completed_q[i_q.name][i.id] || [0, nil]
nutrient_data = completed_q[i_q.name][i.id] || [nil, nil]
[i_q.name, nutrient_data[0]]
end.to_h
]