Make code work for relations and arrays

This commit is contained in:
Luis Ramos
2020-05-19 22:26:26 +01:00
parent 3aeb87debc
commit 399fe2c01b
3 changed files with 5 additions and 5 deletions

View File

@@ -180,11 +180,11 @@ module OpenFoodNetwork
end
def total_untaxable_products(order)
order.line_items.without_tax.sum(&:amount)
order.line_items.without_tax.to_a.sum(&:amount)
end
def total_taxable_products(order)
order.line_items.with_tax.sum(&:amount)
order.line_items.with_tax.to_a.sum(&:amount)
end
def total_untaxable_fees(order)