effective_orders 5.2.12 → 5.2.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/effective/order.rb +13 -5
- data/lib/effective_orders/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ee6f41ea9ce0cfac7925305431dbbe362e436288d427744245fc6dbc915c554
|
4
|
+
data.tar.gz: 35cbbbe657adcb8c2d7c823600f9b8c01f9e7a8de4a54a2eec4279413db035e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf9913f68f1018d10eaf8a3602c410bf0d6e5a733e211bbc0e9b16066458c7bf305e522350ec02083a1cead2dcc228846b894f14c699fcaa0af5d8f62077946d
|
7
|
+
data.tar.gz: 5e1b5b09d51db9180f14ef8665e1dae2b34ad7f20d8f9031d96a8f1c75405ddcb6e9a2bd12f3a735fd894e55c53c7ef0698ddf375ddadf6c8edd061493bb0826
|
@@ -484,7 +484,7 @@ module Effective
|
|
484
484
|
self.payment = payment_to_h(payment) if self.payment.blank?
|
485
485
|
|
486
486
|
begin
|
487
|
-
|
487
|
+
Effective::Order.transaction do
|
488
488
|
run_purchasable_callbacks(:before_purchase)
|
489
489
|
|
490
490
|
save!
|
@@ -493,7 +493,7 @@ module Effective
|
|
493
493
|
run_purchasable_callbacks(:after_purchase)
|
494
494
|
end
|
495
495
|
rescue => e
|
496
|
-
|
496
|
+
Effective::Order.transaction do
|
497
497
|
save!(validate: false)
|
498
498
|
update_purchasables_purchased_order!
|
499
499
|
end
|
@@ -533,7 +533,7 @@ module Effective
|
|
533
533
|
skip_buyer_validations: true
|
534
534
|
)
|
535
535
|
|
536
|
-
|
536
|
+
Effective::Order.transaction do
|
537
537
|
begin
|
538
538
|
run_purchasable_callbacks(:before_decline)
|
539
539
|
save!(validate: validate)
|
@@ -665,11 +665,19 @@ module Effective
|
|
665
665
|
|
666
666
|
def run_purchasable_callbacks(name)
|
667
667
|
order_items.select { |item| item.purchasable.respond_to?(name) }.each do |item|
|
668
|
-
|
668
|
+
if item.class.respond_to?(:transaction)
|
669
|
+
item.class.transaction { item.purchasable.public_send(name, self, item) }
|
670
|
+
else
|
671
|
+
item.purchasable.public_send(name, self, item)
|
672
|
+
end
|
669
673
|
end
|
670
674
|
|
671
675
|
if parent.respond_to?(name)
|
672
|
-
|
676
|
+
if parent.class.respond_to?(:transaction)
|
677
|
+
parent.class.transaction { parent.public_send(name, self) }
|
678
|
+
else
|
679
|
+
parent.public_send(name, self)
|
680
|
+
end
|
673
681
|
end
|
674
682
|
|
675
683
|
true
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_orders
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.2.
|
4
|
+
version: 5.2.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-01-
|
11
|
+
date: 2022-01-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|