effective_orders 5.2.3 → 5.2.7

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: b71f36aac1ec66c0744301209933bc4f642137519bf720a904f5b845f9970dff
4
- data.tar.gz: 1aa4ccb644014cf6d3e1aa4913dc75e475f2b69c67332f8c3a6e07c6612f9259
3
+ metadata.gz: 419b2992feb9ade2fb499b58fc73083cd8a4f1079fb1e355477bf32c0f75a3f4
4
+ data.tar.gz: f31d171a1fd01cdf25dc897080e61797f9d7f2c98b769bde536e59046bee8761
5
5
  SHA512:
6
- metadata.gz: 720181b8b9446f583bb12c19dbb181fd9d31e7615cdccecaf4d6b10bcedbd10217ca1a8af85dca01974274a1f989901fb5aacc8825b2f48993b39ab6ea22f992
7
- data.tar.gz: 857d43e8ffec647adf71a12088eee4800c364f687bb45a154b75df486c6759ffd4b10c462243f82f7a2907c12e902ffbf099134a8e7cfa76d68124105dd88e72
6
+ metadata.gz: d8c6d641ed49d7560d37351dea431f39252cd9e29a0a523c3f4173b9bb72a61315c1ed332a9979938626a80ced4235baafd5c7f753ca6a37c3d1ac97cb4ef3a8
7
+ data.tar.gz: 6624bddc0a1e3c51b8f13cb3bb3f61830831ec7207233cc420187af0e5dc5cee5a49466fe5ea0896d58caff8980d5c4c1b3a3111ad7e603632ce0b535c5e8ea2
@@ -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
 
@@ -320,7 +320,7 @@ module Effective
320
320
 
321
321
  # For moneris and moneris_checkout. Just a unique value.
322
322
  def transaction_id
323
- [to_param, billing_name.to_s.parameterize.presence, Time.zone.now.to_i].compact.join('-')
323
+ [to_param, billing_name.to_s.parameterize.presence, Time.zone.now.to_i, rand(10000)].compact.join('-')
324
324
  end
325
325
 
326
326
  def billing_first_name
@@ -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.3'.freeze
2
+ VERSION = '5.2.7'.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.3
4
+ version: 5.2.7
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-12-03 00:00:00.000000000 Z
11
+ date: 2021-12-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails