diff options
author | Brendan Deere <brendan@stembolt.com> | 2017-01-09 14:53:43 -0800 |
---|---|---|
committer | Brendan Deere <brendan@stembolt.com> | 2017-01-12 15:36:29 -0800 |
commit | 717d4083f594cb2346d2b4fbd0684e5dc88844d8 (patch) | |
tree | c5494a77243e328dbab9be5acadd295226c3e357 /lib/solidus_subscriptions | |
parent | fb00ab0a6feb83ad9d6b55e5bb8c38f697abb162 (diff) |
Deactivate expired subscriptions
While processing subscriptions, after the actionalble date has been
advanced, if the next actionable date is after the
subscriptions#end_date then deactivate the subscription.
Diffstat (limited to 'lib/solidus_subscriptions')
-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 4c1268b..0e38708 100644 --- a/lib/solidus_subscriptions/processor.rb +++ b/lib/solidus_subscriptions/processor.rb @@ -95,6 +95,7 @@ module SolidusSubscriptions sub.successive_skip_count = 0 sub.advance_actionable_date sub.cancel! if sub.pending_cancellation? + sub.deactivate! if sub.can_be_deactivated? sub.installments.create! end end |