From e335c249d8905b8572a00aecb343a7a69ac01ae6 Mon Sep 17 00:00:00 2001 From: "Christopher C. Wells" Date: Fri, 22 Jan 2021 23:58:45 -0800 Subject: [PATCH] Fix old ingredients reference --- app/Models/Traits/HasIngredients.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Models/Traits/HasIngredients.php b/app/Models/Traits/HasIngredients.php index 7017f2d..b6f16c1 100644 --- a/app/Models/Traits/HasIngredients.php +++ b/app/Models/Traits/HasIngredients.php @@ -36,7 +36,7 @@ trait HasIngredients */ private function sumNutrient(string $nutrient): float { $sum = 0; - foreach ($this->ingredients as $ingredientAmount) { + foreach ($this->ingredientAmounts as $ingredientAmount) { $sum += $ingredientAmount->{$nutrient}(); } return $sum;