From b808f839314f8093e71cae427776790d4582bb10 Mon Sep 17 00:00:00 2001 From: FGU Date: Wed, 15 Feb 2023 16:09:11 +0100 Subject: [PATCH] wip --- app/models/group_order.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/group_order.rb b/app/models/group_order.rb index f6198985..09db3c07 100644 --- a/app/models/group_order.rb +++ b/app/models/group_order.rb @@ -63,7 +63,7 @@ class GroupOrder < ApplicationRecord # add counts from the previous group order if previous_group_order previous_group_order.group_order_articles.each do |goa| - order_article_id = OrderArticle.find_by(order: order, article: goa.order_article.article)&.id + order_article_id = OrderArticle.find_by!(order: order, article: goa.order_article.article)&.id data[:order_articles][order_article_id] ||= {} data[:order_articles][order_article_id][:previous_quantity] = goa.quantity data[:order_articles][order_article_id][:previous_tolerance] = goa.tolerance