From 5ad2c9e4ad04c3a1b8215b28a4b2bf61a84ac928 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Mon, 8 Aug 2022 14:47:51 -0500 Subject: [PATCH] Use billing customer for LowBalance notification --- lib/low_balance.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/low_balance.rb b/lib/low_balance.rb index 41bbdd8..a024459 100644 --- a/lib/low_balance.rb +++ b/lib/low_balance.rb @@ -8,10 +8,10 @@ class LowBalance return Locked.new unless customer.registered? ExpiringLock.new( - "jmp_customer_low_balance-#{customer.customer_id}", + "jmp_customer_low_balance-#{customer.billing_customer_id}", expiry: 60 * 60 * 24 * 7 ).with(-> { Locked.new }) do - for_no_lock(customer) + customer.billing_customer.then(&method(:for_no_lock)) end end -- 2.38.4