effective_datatables 4.19.0 → 4.19.1

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: d9a3cae1554f2bcf9b6d73f51972eb1f8bc00c38a30d160c7f8910bf6e339a99
4
- data.tar.gz: 72193d4f4895fa60a933c6be50d2d5d6a9d32d5d09a7f60558b130c2042eee1a
3
+ metadata.gz: 1f5e3d8ed9d497dea48da82cc800596e4b43500d7b85030d1fced300f846218d
4
+ data.tar.gz: c9b2b959192a337aa876830f1c4c9d7b5d6b8f58f89b1ca0812be995ab050e45
5
5
  SHA512:
6
- metadata.gz: 321d799d2a21d4e3d19523ef8ae24d8ae62649bd1656afcc90223b26a77409d00dd8bd80a8f15bd40eb07476ea2b1f4a3eb7500f0f44a4a6b0b98553c873ba1d
7
- data.tar.gz: f35dc8eeabe695ded08c56d80d1f09cfb18ac1e9925cf55d43870ac121d357543e085e9fdeb14020f92a52f6419de45712a0a663cb4429029ee3edcd9f29e9b4
6
+ metadata.gz: 3c045b22d3482ef816c21f157c7cf2fc113f6434a8f0f01a7467f3cff494b1d3dda4dbce680166dc5298c8bb5723f4b3b49ec22679a48c06db792d0752435f67
7
+ data.tar.gz: 250528bb18da5a76ba3d9c1d567d56bea5e58e8093f24bb23e55c8b6821e8f58c24c60a714e245bf5312d5de069c3aaef90d061eec161facefb72765b57c65fd
@@ -15,7 +15,7 @@ module Effective
15
15
  EffectiveDatatables.authorize!(self, :index, @datatable.collection_class)
16
16
 
17
17
  render json: @datatable.to_json
18
- rescue => e
18
+ rescue Exception => e
19
19
  EffectiveDatatables.authorized?(self, :index, @datatable.try(:collection_class))
20
20
  render json: error_json(e)
21
21
 
@@ -84,7 +84,7 @@ module Effective
84
84
  render status: :ok, body: :ok
85
85
  rescue Effective::AccessDenied => e
86
86
  render(status: :unauthorized, body: 'Access Denied')
87
- rescue => e
87
+ rescue Exception => e
88
88
  render(status: :error, body: 'Unexpected Error')
89
89
  end
90
90
 
@@ -24,20 +24,16 @@ module Effective
24
24
  raise "#{method} block must be declared outside the datatable do ... end block"
25
25
  end
26
26
 
27
- if datatable.respond_to?(method)
28
- if block_given?
29
- datatable.send(method, *args, **kwargs) { yield }
30
- else
31
- datatable.send(method, *args, **kwargs)
32
- end
33
- elsif view.respond_to?(method)
34
- if block_given?
35
- view.send(method, *args, **kwargs) { yield }
36
- else
37
- view.send(method, *args, **kwargs)
38
- end
27
+ subject = datatable if datatable.respond_to?(method)
28
+ subject ||= view if view.respond_to?(method)
29
+ subject ||= Tenant.helpers if defined?(Tenant) && Tenant.helpers.respond_to?(method)
30
+
31
+ return super unless subject
32
+
33
+ if block_given?
34
+ subject.send(method, *args, **kwargs) { yield }
39
35
  else
40
- super
36
+ subject.send(method, *args, **kwargs)
41
37
  end
42
38
  end
43
39
 
@@ -1,3 +1,3 @@
1
1
  module EffectiveDatatables
2
- VERSION = '4.19.0'.freeze
2
+ VERSION = '4.19.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_datatables
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.19.0
4
+ version: 4.19.1
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: 2023-09-01 00:00:00.000000000 Z
11
+ date: 2023-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails