effective_orders 4.1.1 → 4.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8bc7d8f3210188ed31b12ab7e99954f29d8b48cb
|
4
|
+
data.tar.gz: c4de6ed1374628fb5e0f3f41934e6a711b121c23
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|