effective_orders 5.2.11 → 5.2.15
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fba0c7839a152e7d31995a7562c016c757e53cea88fd91eebd13716bd5cbd4af
|
4
|
+
data.tar.gz: b4a9abe9ae8b0f4813a2144e4282b3520247f9a44f0a6ed7ce2324eb6b9e397c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73abb8f0c16620de36ad27cf6ca0559a93910617d11eb352674383208352804813068d1f682ef5f22ec5364719ede17c2b40f3ea3b986de71baa16c11706af44
|
7
|
+
data.tar.gz: 07e880765995acda972d4011cda0ac57b750ffdab98bd4e3a5c1cd8a0bb9d68ff55a8e9bc4136df927ae018a9252c9fd8e5df59905387ff83496471582777d5b
|
@@ -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)
|
@@ -611,7 +611,7 @@ module Effective
|
|
611
611
|
|
612
612
|
def assign_order_totals
|
613
613
|
self.subtotal = present_order_items.map { |oi| oi.subtotal }.sum
|
614
|
-
self.tax_rate = get_tax_rate()
|
614
|
+
self.tax_rate = get_tax_rate()
|
615
615
|
self.tax = get_tax()
|
616
616
|
self.total = subtotal + (tax || 0)
|
617
617
|
end
|
@@ -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
|
@@ -68,7 +68,7 @@ module Effective
|
|
68
68
|
# first or build
|
69
69
|
def qb_item_name
|
70
70
|
raise('expected EffectiveQbSync gem') unless defined?(EffectiveQbSync)
|
71
|
-
(qb_order_item || build_qb_order_item(name: purchasable
|
71
|
+
(qb_order_item || build_qb_order_item(name: purchasable&.qb_item_name)).name
|
72
72
|
end
|
73
73
|
|
74
74
|
end
|
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.15
|
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:
|
11
|
+
date: 2022-01-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|