effective_orders 5.2.4 → 5.2.5

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: b05f84b1f3b3cda586c6cb1721b3f7f2b5df015c16b03cea26842dec69e079d0
4
- data.tar.gz: 7064dc16608557f87e3189737c6df2ec54a39fccdf640cb9de40c03a0805011d
3
+ metadata.gz: cc1c2f6fea7135b9b7578bef447c14f3485fd68cef06a2c441c17c08fcce5628
4
+ data.tar.gz: eedc4248429fafb164669fb64a03b0119ae2bbd806847a8022670c0da947ffc9
5
5
  SHA512:
6
- metadata.gz: e2701472dd97d9fa7e8c02729abe8b403e59279ba551628efaebf35b9f0b4a72e5574a8620ee11b94b033f996f459ddd215596e9ed119b07d25f015759457eaf
7
- data.tar.gz: e612099005a16265d1d3f4165de40bf23e55fbc36252f66310ef04fbc0e3a993c4fa7f72357134e5ab2850d4c78d032498054afa0c9c3ce80a4345ef29ce511a
6
+ metadata.gz: 7b7955c3e945f81015f7f3958cd70ccb80dc55fc935c7e29043a4f2b2174c700c42f9bf32dc322b3743cc2ec5d1b1c38682a24dfcf6322cd631315b63d99b049
7
+ data.tar.gz: 06e6e17294699a973be1d3b34a6cf0a5d97623e9e9523e9a618113f783bd7ffbefce7d2dd8ec113139feb35d69d120130ca6adb8c917c18f598439adf83012ae
@@ -93,9 +93,10 @@ class Admin::EffectiveOrdersDatatable < Effective::Datatable
93
93
  end
94
94
 
95
95
  if attributes[:user_id].present?
96
- user_klass = (attributes[:user_type].safe_constantize || current_user.class)
97
- user = user_klass.find(attributes[:user_id])
96
+ user_klass = (attributes[:user_type].constantize if attributes[:user_type].present?)
97
+ user_klass ||= current_user.class
98
98
 
99
+ user = user_klass.find(attributes[:user_id])
99
100
  scope = scope.where(user: user)
100
101
  end
101
102
 
@@ -62,7 +62,9 @@ class EffectiveOrdersDatatable < Effective::Datatable
62
62
  end
63
63
 
64
64
  collection do
65
- user_klass = (attributes[:user_type].safe_constantize || current_user.class)
65
+ user_klass = (attributes[:user_type].constantize if attributes[:user_type].present?)
66
+ user_klass ||= current_user.class
67
+
66
68
  user = user_klass.find(attributes[:user_id])
67
69
 
68
70
  scope = Effective::Order.all.deep.where(user: user)
@@ -1,3 +1,3 @@
1
1
  module EffectiveOrders
2
- VERSION = '5.2.4'.freeze
2
+ VERSION = '5.2.5'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_orders
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.2.4
4
+ version: 5.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect