From e020c592ec643cec945b0aafe53c054157e85ff0 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Tue, 27 Dec 2022 14:39:26 +0100 Subject: [PATCH] (bug) rebuild accounting when invoices(0).disabled --- app/models/advanced_accounting.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/advanced_accounting.rb b/app/models/advanced_accounting.rb index 743785c39..f68537b16 100644 --- a/app/models/advanced_accounting.rb +++ b/app/models/advanced_accounting.rb @@ -25,7 +25,7 @@ class AdvancedAccounting < ApplicationRecord else raise TypeError "Unknown accountable_type #{accountable_type}" end - ids = invoices.map(&:id) + ids = invoices.filter { |i| !i.nil? }.map(&:id) AccountingWorker.perform_async(:invoices, ids) end end