summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBrendan Deere <brendan@stembolt.com>2016-10-06 14:18:23 -0700
committerBrendan Deere <brendan@stembolt.com>2016-10-06 14:39:40 -0700
commit83e252009d3505aaf189e3b370faa521ecd628bd (patch)
tree5dd2483159131f7b0fd35af52a566114a3f79206 /lib
parentd6aa2f89d92eeb858b1fea4967005e5e02cac07b (diff)
Reset successive skip count
When the subscription is processed its successive skip count should be reset to 0
Diffstat (limited to 'lib')
-rw-r--r--lib/solidus_subscriptions/processor.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/solidus_subscriptions/processor.rb b/lib/solidus_subscriptions/processor.rb
index c035ecf..40ff35e 100644
--- a/lib/solidus_subscriptions/processor.rb
+++ b/lib/solidus_subscriptions/processor.rb
@@ -82,6 +82,7 @@ module SolidusSubscriptions
def new_installments(user)
subscriptions_by_id.fetch(user.id, []).map do |sub|
ActiveRecord::Base.transaction do
+ sub.successive_skip_count = 0
sub.advance_actionable_date
sub.cancel! if sub.pending_cancellation?
sub.installments.create!