effective_datatables 4.13.2 → 4.13.3

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: 583ae9463f2ad7039927ee730e77d0735a25aa2659706aed89a1e1e60fc2b097
4
- data.tar.gz: aae985bb6164d773959732e955ce1a9264be1830544fbce3676707e05a48ce25
3
+ metadata.gz: 195e2fea792167d2a115b603eca328921936b989a2ee8250f927f2dc0e7c9135
4
+ data.tar.gz: 945313e0c3188ece78cd3a89ec0cad517f1e72b65424b51718887d1670d477ca
5
5
  SHA512:
6
- metadata.gz: 30fbdba242e5697eda518dfe4115eb17f31840bfe1c1400493abd7b82111a0eb5a6c4ebf0ce20f70d281d30310651722931540e3a6524795fa4866cbea9de96c
7
- data.tar.gz: 85328b0f4914e3d9a7d43b777b10dde7aeae118041781f039aca78f96671f387556fcc6ca7d5d51b02eff338943ebeef52d138374d5786f8d7c402a6ba20de31
6
+ metadata.gz: 8a833adb0cdd8b0f98775b2245b1a6fd5d08c5237ba0f01e42e3e34fe3e170073e40c70d1d43af4670f9fbad2e838a8540be6d9d33cbbb987fb2ec97e6fbcc11
7
+ data.tar.gz: 6f3e823b061a30a69499dab532a2b385233409ef9c72b24a91aac25c7527244e88dfd304bff9ca2cf824ebc3b864b6b38e3ab503f79f361d1d89dccaca2031e2
@@ -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
- collection.public_send(csv_collection_method) do |resources|
40
- resources = arrayize(resources, csv: true)
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
- def csv_collection_method
52
- (active_record_collection? ? :find_in_batches : :to_a)
56
+ end
53
57
  end
54
58
 
55
59
  end
@@ -1,3 +1,3 @@
1
1
  module EffectiveDatatables
2
- VERSION = '4.13.2'.freeze
2
+ VERSION = '4.13.3'.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.13.2
4
+ version: 4.13.3
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-23 00:00:00.000000000 Z
11
+ date: 2022-12-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails