From 5ad9618cfeaf6e8aa26cb23798cb85c2c20fa22c Mon Sep 17 00:00:00 2001 From: Sean Date: Tue, 15 Dec 2020 14:43:08 -0600 Subject: Avoid processing installments with cancelled subscriptions Anyone who cancels their subscription with a failed installment will still have an order created the next time installments are created. This is because installments don't check the status of their associated subscriptions before being processed. This update will ensure that only installments with active subscriptions are processed. --- lib/solidus_subscriptions/processor.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/solidus_subscriptions/processor.rb') diff --git a/lib/solidus_subscriptions/processor.rb b/lib/solidus_subscriptions/processor.rb index 4946b5a..d56816a 100644 --- a/lib/solidus_subscriptions/processor.rb +++ b/lib/solidus_subscriptions/processor.rb @@ -34,7 +34,7 @@ module SolidusSubscriptions ). where( SolidusSubscriptions::Subscription.actionable.arel.constraints.reduce(:and). - or(SolidusSubscriptions::Installment.actionable.arel.constraints.reduce(:and)) + or(SolidusSubscriptions::Installment.actionable.with_active_subscription.arel.constraints.reduce(:and)) ). distinct. find_in_batches -- cgit v1.2.3