effective_datatables 4.16.1 → 4.16.2
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '079ed09629f9c21a2d1e56da78d611258f57953200eba9724ee756c699db49ce'
|
4
|
+
data.tar.gz: 76fd2c6b7380bb02482312120c2b04ab68cd8a3e0e08c18815c838ac0f9ff58b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 05ea2263405fbd49445e82e14240405794d14b86caf704115584f5de46ca1ba5fc8b685c2de66b612f3b540c80148ad6257cd3352a63e56bd02f6f303058af3b
|
7
|
+
data.tar.gz: cde3bf3b0bb9c8aa21b5b877da243c01069dcea07ca9e30d4b4e342839b66d7ecf5f1fe7087dbfbf5dc412d20a991b810171dea3c340934cf3da354b9f35e9d5
|
@@ -24,7 +24,7 @@ module Effective
|
|
24
24
|
if active_record_collection?
|
25
25
|
collection_class.human_attribute_name(name)
|
26
26
|
else
|
27
|
-
(name.to_s.split('.').last
|
27
|
+
(name.to_s.split('.').last.titleize|| '')
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
@@ -32,8 +32,17 @@ module Effective
|
|
32
32
|
CSV.generate do |csv|
|
33
33
|
csv << csv_header()
|
34
34
|
|
35
|
-
|
36
|
-
|
35
|
+
if active_record_collection?
|
36
|
+
collection.find_in_batches do |resources|
|
37
|
+
resources = arrayize(resources, csv: true)
|
38
|
+
format(resources, csv: true)
|
39
|
+
finalize(resources)
|
40
|
+
|
41
|
+
resources.each { |resource| csv << resource }
|
42
|
+
end
|
43
|
+
else
|
44
|
+
resources = collection
|
45
|
+
|
37
46
|
format(resources, csv: true)
|
38
47
|
finalize(resources)
|
39
48
|
|
@@ -10,20 +10,20 @@ module Effective
|
|
10
10
|
return @_datatables_ajax_request unless @_datatables_ajax_request.nil?
|
11
11
|
return unless view.respond_to?(:params)
|
12
12
|
|
13
|
-
@_datatables_ajax_request = (view.params.key?(:draw) && view.params.key?(:columns))
|
13
|
+
@_datatables_ajax_request = view.params.present? && (view.params.key?(:draw) && view.params.key?(:columns))
|
14
14
|
end
|
15
15
|
|
16
16
|
def datatables_inline_request?
|
17
17
|
return @_datatables_inline_request unless @_datatables_inline_request.nil?
|
18
18
|
return unless view.respond_to?(:params)
|
19
19
|
|
20
|
-
@_datatables_inline_request = (view.params[:_datatable_id].to_s.split('-')[0...-1] == to_param.split('-')[0...-1])
|
20
|
+
@_datatables_inline_request = view.params.present? && (view.params[:_datatable_id].to_s.split('-')[0...-1] == to_param.split('-')[0...-1])
|
21
21
|
end
|
22
22
|
|
23
23
|
def params
|
24
24
|
return {} unless view.present?
|
25
25
|
return view.rendered_params if view.respond_to?(:rendered_params)
|
26
|
-
return {} unless view.respond_to?(:request)
|
26
|
+
return {} unless view.respond_to?(:request) && view.request.present?
|
27
27
|
|
28
28
|
@params ||= {}.tap do |params|
|
29
29
|
Rack::Utils.parse_query(URI(view.request.referer.presence || '/').query).each { |k, v| params[k.to_sym] = v }
|
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.16.
|
4
|
+
version: 4.16.2
|
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-03-
|
11
|
+
date: 2023-03-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|