effective_datatables 4.19.1 → 4.20.0

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: 1f5e3d8ed9d497dea48da82cc800596e4b43500d7b85030d1fced300f846218d
4
- data.tar.gz: c9b2b959192a337aa876830f1c4c9d7b5d6b8f58f89b1ca0812be995ab050e45
3
+ metadata.gz: c5bf5141b655e975b0e158b2f33572d8b8acc1f13ffa50d25f761795c6cdeb25
4
+ data.tar.gz: 67c30d8895b19d093e43e6ae1b521a528a18ea8ca156ca90209e8c1c922248c2
5
5
  SHA512:
6
- metadata.gz: 3c045b22d3482ef816c21f157c7cf2fc113f6434a8f0f01a7467f3cff494b1d3dda4dbce680166dc5298c8bb5723f4b3b49ec22679a48c06db792d0752435f67
7
- data.tar.gz: 250528bb18da5a76ba3d9c1d567d56bea5e58e8093f24bb23e55c8b6821e8f58c24c60a714e245bf5312d5de069c3aaef90d061eec161facefb72765b57c65fd
6
+ metadata.gz: 0d08c8f32b066240576a4e4ee4cdea3916999d6c26f44e9c4533b125625de29922ae49ceebfdbd9ce68ba6be5d7da81255f9b60e54af5a250b380ae9bab94952
7
+ data.tar.gz: e20da9812bae53fbcaf98fc18022d624c41fe918f544607ea6a7ad0c8d8d062b9f4c8dc89fe5ca067e3b9daf2e47e2537404ce40a50d0c514b475a06b9aa05b7
@@ -92,10 +92,6 @@ module Effective
92
92
  def format_column(value, column, csv: false)
93
93
  return if value.nil? || (column[:resource] && value.blank?)
94
94
 
95
- unless column[:as] == :email
96
- return value if value.kind_of?(String)
97
- end
98
-
99
95
  if value.kind_of?(Array) && column[:as] == :string
100
96
  if csv
101
97
  return value.map { |v| format_column(v, column, csv: csv) }.join("\n")
@@ -145,6 +141,16 @@ module Effective
145
141
  end
146
142
  when :time
147
143
  value.respond_to?(:strftime) ? value.strftime(EffectiveDatatables.format_time) : BLANK
144
+ when :text
145
+ if csv
146
+ value
147
+ elsif value.to_s.starts_with?('<') && value.ends_with?('>')
148
+ view.sanitize(value.to_s)
149
+ else
150
+ view.simple_format(value.to_s)
151
+ end
152
+ when :string
153
+ csv ? value : view.escape_once(value.to_s)
148
154
  else
149
155
  value.to_s
150
156
  end
@@ -1,3 +1,3 @@
1
1
  module EffectiveDatatables
2
- VERSION = '4.19.1'.freeze
2
+ VERSION = '4.20.0'.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.1
4
+ version: 4.20.0
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-20 00:00:00.000000000 Z
11
+ date: 2023-10-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails