diff options
author | Brendan Deere <brendan@stembolt.com> | 2016-10-03 11:24:10 -0700 |
---|---|---|
committer | Brendan Deere <brendan@stembolt.com> | 2016-10-04 13:15:14 -0700 |
commit | e00c9c5ffa8ece1720bd8f8c7b8de8f6322c1388 (patch) | |
tree | 781564560a2827011fad67e886acf55ef4e4e3ad /lib/solidus_subscriptions/processor.rb | |
parent | 16924ab31d2aa6f899b72db887af38e28d47aedf (diff) |
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
Diffstat (limited to 'lib/solidus_subscriptions/processor.rb')
-rw-r--r-- | lib/solidus_subscriptions/processor.rb | 1 |
1 files changed, 1 insertions, 0 deletions
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 |