From 38e3c5b1d1b4cf99a11ac5fb3074345cb2317a44 Mon Sep 17 00:00:00 2001 From: Thomas Burkhalter Date: Fri, 16 Feb 2024 12:13:13 +0100 Subject: [PATCH] Fix AR logic that broke with the rails upgrade --- app/domain/invoicing/small_invoice/invoice_sync.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/domain/invoicing/small_invoice/invoice_sync.rb b/app/domain/invoicing/small_invoice/invoice_sync.rb index 2067f778..ca189c0c 100644 --- a/app/domain/invoicing/small_invoice/invoice_sync.rb +++ b/app/domain/invoicing/small_invoice/invoice_sync.rb @@ -38,7 +38,9 @@ def sync_unpaid def unpaid_invoices Invoice .joins(order: :status) - .where.not(status: 'paid', invoicing_key: nil, order_statuses: { closed: true }) + .where.not(status: :paid) + .where.not(invoicing_key: nil) + .where.not(order_statuses: { closed: true }) end def notify_sync_error(error, invoice)