1
0

Fixed importing Foods with QuantityValue

Fixed double flash when not followed by request
Added Food#destroy error reporting
Simplified prepare_meals with no ingredients
Renamed scope on item with subitems: subitems -> with_subitems
This commit is contained in:
cryptogopher
2020-05-20 23:33:34 +02:00
parent fa9c329a81
commit a416e1ce9b
13 changed files with 29 additions and 17 deletions

View File

@@ -38,7 +38,7 @@ module BodyTracking
items = all
subitems = Hash.new { |h,k| h[k] = {} }
all.subitems.order('quantities.lft').each do |i|
all.with_subitems.order('quantities.lft').each do |i|
i.subitems.each do |s|
subitem_value = i.respond_to?(:amount) ? i.amount*s.amount/s.ref_amount : s.value
subitems[s.quantity][i] = [subitem_value, s.unit]