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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e6fc5fddf4893dd467c30bd2ae4f505b1c4f4f191e819601364bc230d8530627
4
- data.tar.gz: 6a157d58abcf4836b1324b17dbee3fcb502e23e2924d59daa1ef8a957cb91fbb
3
+ metadata.gz: 3ee6f41ea9ce0cfac7925305431dbbe362e436288d427744245fc6dbc915c554
4
+ data.tar.gz: 35cbbbe657adcb8c2d7c823600f9b8c01f9e7a8de4a54a2eec4279413db035e7
5
5
  SHA512:
6
- metadata.gz: 9c98604d9238a92c62d41422b31f63001144fa47eaa5dbcf7359cf98ec849e8846d07db9be11e498df0024b66212bb674afcc646ab9f7bf4922c8b446a947ba5
7
- data.tar.gz: 537d27c651f334bb17a189d4f3085eca6f0b33e9aaa742ea9ae270f5f3f6d00746d56007a10a5abbe2941ecbd083ae42a052bfbeecc627f0a79e31076b2dcb7c
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
- EffectiveResources.transaction do
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
- EffectiveResources.transaction do
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
- EffectiveResources.transaction do
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
- EffectiveResources.transaction(item) { item.purchasable.public_send(name, self, item) }
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
- EffectiveResources.transaction(parent) { parent.public_send(name, self) }
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
@@ -1,3 +1,3 @@
1
1
  module EffectiveOrders
2
- VERSION = '5.2.12'.freeze
2
+ VERSION = '5.2.13'.freeze
3
3
  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.12
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-04 00:00:00.000000000 Z
11
+ date: 2022-01-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails