effective_orders 4.1.1 → 4.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: af4efa3c792e1b34f177d52b18445ce7f30be3d5
4
- data.tar.gz: 30263da58a648a93672514ad67bdd2b141ca38b1
3
+ metadata.gz: 8bc7d8f3210188ed31b12ab7e99954f29d8b48cb
4
+ data.tar.gz: c4de6ed1374628fb5e0f3f41934e6a711b121c23
5
5
  SHA512:
6
- metadata.gz: 30d73984681fde16edb4bc2656302365075fb4a0786cb81c83f22cb0c150629faec7fb776fc3c0662c5711d7d7831d84c50aadb64bfc4f85797b666506fa352f
7
- data.tar.gz: 95d334d4f35d525e4e25de0c1260379895405f3cbe346fe12525fe604989ee095f0a4d9a08a3043f9accda42acdb86e0e62c1d076c8199be48406d067f2f0025
6
+ metadata.gz: 7178d70dbb59450824f7c768b4592e859a569a1ffa3d6a5853f00efa6bd28a741af17f5f53e11ed499075c4ce7624b4067027ef041d573d81b0471ac26782dd7
7
+ data.tar.gz: 7cea6c6ce5f8b82e94eddc4271c0ef33869535d98edf33f198afcd0d5581a91b7dace42982b8e77a71e8483dc6b29e5abe6996ffa7508da1f08030b94eb38cf2
@@ -17,7 +17,7 @@ module ActsAsSubscribable
17
17
  end
18
18
 
19
19
  included do
20
- has_one :subscription, as: :subscribable, class_name: 'Effective::Subscription'
20
+ has_one :subscription, as: :subscribable, class_name: 'Effective::Subscription', inverse_of: :subscribable
21
21
  has_one :customer, through: :subscription, class_name: 'Effective::Customer'
22
22
 
23
23
  before_validation(if: -> { trialing_until.blank? && EffectiveOrders.trial? }) do
@@ -64,15 +64,12 @@ module Effective
64
64
  end
65
65
 
66
66
  def destroy!
67
- return true unless plan
68
-
69
67
  subscription = subscribable.subscription
68
+ return true if subscription.blank?
70
69
 
71
70
  Rails.logger.info " -> [STRIPE] delete subscription"
72
71
  subscription.stripe_subscription.delete
73
72
  subscription.destroy!
74
-
75
- true
76
73
  end
77
74
 
78
75
  protected
@@ -1,3 +1,3 @@
1
1
  module EffectiveOrders
2
- VERSION = '4.1.1'.freeze
2
+ VERSION = '4.1.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_orders
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.1
4
+ version: 4.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect