effective_datatables 4.35.6 → 4.35.8

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: 8ab65189ed1e2c54881c158932f9e31a6e0eebec39878246272a5bd0452546d1
4
- data.tar.gz: 27ac2e19025bb398fe655c5e3b11449a73f685d9ccc43b7dd06461cc0ec01eea
3
+ metadata.gz: 65886b54462041f8740017339f24c20cf01508ef6198f2ed40be654e300c1761
4
+ data.tar.gz: 8c100cdb08911f6abae96d8c077a404030d569408c1e60af760bd0ca0eb10e1b
5
5
  SHA512:
6
- metadata.gz: 9b2c15ebc275263492e11f4b27199e15e9a6834158c443aa3e86c27a489f52a38d8b58bd7bd01f10f621a7c9efc70ba03d170ebc4b2425b5ec54007438191f6a
7
- data.tar.gz: 8ae905ce8a515bcfe28a2f5aa931b3aa775d18bcdf7c92fbdde77691345b61340de2e508b896b6014b5f3929fa06bbdea7c172509c965fe2bd961e9b3b62ab41
6
+ metadata.gz: dd4e31f6922927fd6397a75773abf07863c51a778708d2bc3f5120822e33fa27d798405a7ada82b2a84beafa9cfc9f752a11e1e44f7cfe73359e53fb55be5110
7
+ data.tar.gz: 66c2a0d080a5024f4f33314fe6a7fd05effd832b8a41c5ee261e197ea28711a4bfc37339bc114af3302bfbedf0800e80dea144d3309f75e778372f43010adaa5
@@ -27,6 +27,7 @@ module Effective
27
27
  def download
28
28
  @datatable = EffectiveDatatables.find(params[:id], params[:attributes])
29
29
  @datatable.view = view_context
30
+ @datatable.csv = true
30
31
 
31
32
  EffectiveDatatables.authorize!(self, :index, @datatable.collection_class)
32
33
 
@@ -26,6 +26,9 @@ module Effective
26
26
  # Set by DSL so we can track where this datatable is coming from
27
27
  attr_accessor :source_location
28
28
 
29
+ # Set to true when CSV download
30
+ attr_accessor :csv
31
+
29
32
  extend Effective::EffectiveDatatable::Dsl
30
33
 
31
34
  include Effective::EffectiveDatatable::Attributes
@@ -275,6 +278,10 @@ module Effective
275
278
  DatatableFiltersForm.new(datatable: self)
276
279
  end
277
280
 
281
+ def csv?
282
+ csv == true
283
+ end
284
+
278
285
  private
279
286
 
280
287
  def column_tool
@@ -29,6 +29,8 @@ module Effective
29
29
  end
30
30
 
31
31
  def csv_file
32
+ view.lookup_context.formats = [:html]
33
+
32
34
  CSV.generate do |csv|
33
35
  csv << csv_header()
34
36
 
@@ -60,6 +62,8 @@ module Effective
60
62
  end
61
63
 
62
64
  def csv_stream
65
+ view.lookup_context.formats = [:html]
66
+
63
67
  EffectiveResources.with_resource_enumerator do |lines|
64
68
  lines << CSV.generate_line(csv_header)
65
69
 
@@ -51,7 +51,7 @@ module Effective
51
51
  csv: csv,
52
52
  format: (format if block_given?),
53
53
  index: nil,
54
- label: label,
54
+ label: (label.try(:html_safe) || label),
55
55
  name: name,
56
56
  partial: partial,
57
57
  partial_as: partial_as,
@@ -80,7 +80,7 @@ module Effective
80
80
  csv: csv,
81
81
  format: nil,
82
82
  index: nil,
83
- label: label,
83
+ label: (label.try(:html_safe) || label),
84
84
  name: name,
85
85
  partial: partial,
86
86
  partial_as: partial_as,
@@ -1,3 +1,3 @@
1
1
  module EffectiveDatatables
2
- VERSION = '4.35.6'.freeze
2
+ VERSION = '4.35.8'.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.35.6
4
+ version: 4.35.8
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: 2026-01-30 00:00:00.000000000 Z
11
+ date: 2026-02-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails