effective_orders 5.2.2 → 5.2.6

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: a7da6644ca7ccf8e9bcc7b2326e0b68e7290bb75ab21324a81ae7e94cc912473
4
- data.tar.gz: 41de16ee30c34ec82299e9e372d7df60a9ae862a0fb44ae4accfb964910ae5c4
3
+ metadata.gz: 36c18b8ae581c3810b506b1109b875ca85348eb696a4349d03393d94b1a4dcde
4
+ data.tar.gz: 38094b154acd13da226a1f6d89ce03424c0789ab060c5ed95ec3231e197c1546
5
5
  SHA512:
6
- metadata.gz: 06cc3930613fa6359f603df842a44ec24d85e4d104aad2f41c964eaf800f1b98d16e2e04a3a91cfe9f7ec6a56b3516e69b579a1b709cbbe413306f60fcf20070
7
- data.tar.gz: b5d5f0e94ef38065f924d66fca1f6124baf15b956639c216e72a1da13e205fcf22304c9be410c07e2ee79f147f8abda0c17d1cb4cedc2a7eaa49fbbf6893ee0b
6
+ metadata.gz: f85cf4d158028ced1bdc215af18dde0977769d530f1161db1f8bf8cd69ce8d8015774cd938af53a69c4b1163fb67308def2bf08299822818b8572d99c780321a
7
+ data.tar.gz: cc7fb7ababed9e55f759e31091eb21f9db3ec11a403f8f9d2b755f14aa84cf449801302aadded96951143ad503541fee312a20b035a4ac5d367a46f419c86c25
@@ -93,7 +93,10 @@ class Admin::EffectiveOrdersDatatable < Effective::Datatable
93
93
  end
94
94
 
95
95
  if attributes[:user_id].present?
96
- user = current_user.class.find(attributes[:user_id])
96
+ user_klass = (attributes[:user_type].constantize if attributes[:user_type].present?)
97
+ user_klass ||= current_user.class
98
+
99
+ user = user_klass.find(attributes[:user_id])
97
100
  scope = scope.where(user: user)
98
101
  end
99
102
 
@@ -62,7 +62,10 @@ class EffectiveOrdersDatatable < Effective::Datatable
62
62
  end
63
63
 
64
64
  collection do
65
- user = current_user.class.find(attributes[:user_id])
65
+ user_klass = (attributes[:user_type].constantize if attributes[:user_type].present?)
66
+ user_klass ||= current_user.class
67
+
68
+ user = user_klass.find(attributes[:user_id])
66
69
 
67
70
  scope = Effective::Order.all.deep.where(user: user)
68
71
 
@@ -596,7 +596,7 @@ module Effective
596
596
  end
597
597
 
598
598
  def assign_email
599
- self.email = user&.email
599
+ self.email = user&.email if user&.email.present?
600
600
  end
601
601
 
602
602
  def assign_last_address
@@ -1,3 +1,3 @@
1
1
  module EffectiveOrders
2
- VERSION = '5.2.2'.freeze
2
+ VERSION = '5.2.6'.freeze
3
3
  end
@@ -116,7 +116,7 @@ module EffectiveOrders
116
116
 
117
117
  # The Effective::Order.payment_provider value must be in this collection
118
118
  def self.payment_providers
119
- @payment_providers ||= [
119
+ [
120
120
  ('cheque' if cheque?),
121
121
  ('credit card' if mark_as_paid?),
122
122
  ('free' if free?),
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.2
4
+ version: 5.2.6
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: 2021-11-28 00:00:00.000000000 Z
11
+ date: 2021-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails