solidus_promotions 4.6.3 → 4.6.4
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
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c8eaf46d738aec4c08a0f6f3b05054ea0bbd69b6acaeb19a039d1e83a06ba58e
|
|
4
|
+
data.tar.gz: d7768863c9722b81c2607fdec686eb9e6d119329b9f58893d086247667bff577
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 92f71d86f1d14b93ce0bfed67c84a7789281384520ce26b3839aa1d0fed49e31f634130a9e496587170a61dba8a9b3167d758e0cdccd6d15dc6eb45c878411c3
|
|
7
|
+
data.tar.gz: 6d31451f7d4fece542a57f3935ab13529693cc21ab366fe7596d438df9a76a8dee0757adde0ade49a13e2fb4927d344891d1f11e50a5af65aafd3dd1d0984b42
|
|
@@ -12,7 +12,13 @@ module SolidusPromotions
|
|
|
12
12
|
before_destroy :remove_adjustments_from_incomplete_orders
|
|
13
13
|
before_destroy :raise_for_adjustments_for_completed_orders
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
# @!attribute [rw] promotion
|
|
16
|
+
# The owning promotion.
|
|
17
|
+
# @return [SolidusPromotions::Promotion]
|
|
18
|
+
belongs_to :promotion, -> { with_discarded }, inverse_of: :benefits
|
|
19
|
+
# @!attribute [rw] original_promotion_action
|
|
20
|
+
# Back-reference to the original Solidus (Spree) promotion action, when migrated.
|
|
21
|
+
# @return [Spree::PromotionAction, nil]
|
|
16
22
|
belongs_to :original_promotion_action, class_name: "Spree::PromotionAction", optional: true
|
|
17
23
|
has_many :adjustments, class_name: "Spree::Adjustment", as: :source, dependent: :restrict_with_error
|
|
18
24
|
has_many :shipping_rate_discounts, class_name: "SolidusPromotions::ShippingRateDiscount", inverse_of: :benefit, dependent: :restrict_with_error
|
|
@@ -12,7 +12,7 @@ module SolidusPromotions
|
|
|
12
12
|
optional: true,
|
|
13
13
|
inverse_of: :promotions
|
|
14
14
|
belongs_to :original_promotion, class_name: "Spree::Promotion", optional: true
|
|
15
|
-
has_many :benefits, class_name: "SolidusPromotions::Benefit", dependent: :destroy
|
|
15
|
+
has_many :benefits, class_name: "SolidusPromotions::Benefit", dependent: :destroy, inverse_of: :promotion
|
|
16
16
|
has_many :conditions, through: :benefits
|
|
17
17
|
has_many :codes, class_name: "SolidusPromotions::PromotionCode", dependent: :destroy, inverse_of: :promotion
|
|
18
18
|
has_many :code_batches, class_name: "SolidusPromotions::PromotionCodeBatch", dependent: :destroy
|
|
@@ -171,6 +171,7 @@ module SolidusPromotions
|
|
|
171
171
|
|
|
172
172
|
def delete_cart_connections
|
|
173
173
|
order_promotions.where(order: Spree::Order.incomplete).destroy_all
|
|
174
|
+
benefits.each(&:remove_adjustments_from_incomplete_orders)
|
|
174
175
|
end
|
|
175
176
|
end
|
|
176
177
|
end
|