effective_datatables 4.13.2 → 4.13.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/effective/datatable.rb +4 -0
- data/app/models/effective/effective_datatable/cookie.rb +2 -0
- data/app/models/effective/effective_datatable/csv.rb +12 -8
- data/app/models/effective/effective_datatable/dsl/datatable.rb +4 -0
- data/lib/effective_datatables/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bb08f8a05559f50227ad9957db50f1fe46952a3509b8ec2a633b5991cc2984fb
|
4
|
+
data.tar.gz: 161bf01768bd46d37eac6e15e966b7dc5c2c9bc6a120c28510cc47b5d92414dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b7f399eccc357014bbcbce19dc9e75cc8196865a5a6943d0dbf8f850e9acd316a5ece105d03ccca61efc774faf3a627b4e9d48b0d93ec230af128b99e1eb07e
|
7
|
+
data.tar.gz: 778322bf428c4528520b7726466ac7bb57e63105967809c30846c12e2f351c613a18928efde8bf999ee89d6e2d492ad0eae3541543ff0f337733b99776789337
|
@@ -182,6 +182,10 @@ module Effective
|
|
182
182
|
attributes[:downloadable] != false
|
183
183
|
end
|
184
184
|
|
185
|
+
def skip_save_state?
|
186
|
+
attributes[:skip_save_state] == true
|
187
|
+
end
|
188
|
+
|
185
189
|
# Whether the filters must be rendered as a <form> or we can keep the normal <div> behaviour
|
186
190
|
def _filters_form_required?
|
187
191
|
_form[:verb].present?
|
@@ -12,6 +12,7 @@ module Effective
|
|
12
12
|
|
13
13
|
def load_cookie!
|
14
14
|
return unless EffectiveDatatables.save_state
|
15
|
+
return if skip_save_state?
|
15
16
|
return unless (view.cookies rescue false) # Rails 6.1 view doesn't respond_to?(:cookies)
|
16
17
|
|
17
18
|
@dt_cookie = view.cookies.signed['_effective_dt']
|
@@ -36,6 +37,7 @@ module Effective
|
|
36
37
|
|
37
38
|
def save_cookie!
|
38
39
|
return unless EffectiveDatatables.save_state
|
40
|
+
return if skip_save_state?
|
39
41
|
return unless (view.cookies rescue false)
|
40
42
|
|
41
43
|
@dt_cookie ||= []
|
@@ -36,20 +36,24 @@ module Effective
|
|
36
36
|
EffectiveResources.with_resource_enumerator do |lines|
|
37
37
|
lines << CSV.generate_line(csv_header)
|
38
38
|
|
39
|
-
|
40
|
-
|
39
|
+
if active_record_collection?
|
40
|
+
collection.find_in_batches do |resources|
|
41
|
+
resources = arrayize(resources, csv: true)
|
42
|
+
format(resources, csv: true)
|
43
|
+
finalize(resources)
|
44
|
+
|
45
|
+
resources.each { |resource| lines << CSV.generate_line(resource) }
|
46
|
+
end
|
47
|
+
else
|
48
|
+
resources = collection
|
49
|
+
|
41
50
|
format(resources, csv: true)
|
42
51
|
finalize(resources)
|
43
52
|
|
44
53
|
resources.each { |resource| lines << CSV.generate_line(resource) }
|
45
54
|
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
private
|
50
55
|
|
51
|
-
|
52
|
-
(active_record_collection? ? :find_in_batches : :to_a)
|
56
|
+
end
|
53
57
|
end
|
54
58
|
|
55
59
|
end
|
@@ -30,6 +30,10 @@ module Effective
|
|
30
30
|
datatable.attributes[:downloadable] = bool
|
31
31
|
end
|
32
32
|
|
33
|
+
def skip_save_state!
|
34
|
+
datatable.attributes[:skip_save_state] = true
|
35
|
+
end
|
36
|
+
|
33
37
|
# A col has its internal values sorted/searched before the block is run
|
34
38
|
# Anything done in the block, is purely a format on the after sorted/ordered value
|
35
39
|
# the original object == the computed value, which is yielded to the format block
|
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.13.
|
4
|
+
version: 4.13.4
|
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: 2022-
|
11
|
+
date: 2022-12-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|