From e00c9c5ffa8ece1720bd8f8c7b8de8f6322c1388 Mon Sep 17 00:00:00 2001 From: Brendan Deere Date: Mon, 3 Oct 2016 11:24:10 -0700 Subject: Processor cancels subs If the processor processed a subscription in the pending_cancellation state, it cancels the subscription after creating one last installment for it --- lib/solidus_subscriptions/processor.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/solidus_subscriptions/processor.rb') diff --git a/lib/solidus_subscriptions/processor.rb b/lib/solidus_subscriptions/processor.rb index f95e16f..4c4894e 100644 --- a/lib/solidus_subscriptions/processor.rb +++ b/lib/solidus_subscriptions/processor.rb @@ -83,6 +83,7 @@ module SolidusSubscriptions subscriptions_by_id.fetch(user.id, []).map do |sub| ActiveRecord::Base.transaction do sub.advance_actionable_date + sub.cancel! if sub.pending_cancellation? sub.installments.create! end end -- cgit v1.2.3