effective_datatables 4.20.1 → 4.20.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: eb9f04b853ac311223db59175787b3b9671a5e5eb74c97a393f5d575ac72f714
4
- data.tar.gz: 4db05c99cee7e59f7cd4e36018246a8a37348380317511414ee07fbf4ff0d690
3
+ metadata.gz: b290520f84f92726953ea0aef6cfa1e5c8d6acdafbc1701f6fb542357d077010
4
+ data.tar.gz: 9f7a715b57a9edf9dc31b806bdc85287e505a3e7766957599f555073ea43e71e
5
5
  SHA512:
6
- metadata.gz: ebe4d62789555527455fcd14bb7a90b75dc66274ee7ee76fcec1522a34e97d1db22074ceaef131b27dbac62744a678fd870c0b6d845d3eb723ef03a71f1bfebf
7
- data.tar.gz: 1f705f91ad14fe6735e60771d2ab64717622d36da4da0291ba43683612b458400f7572b474634452a33793a175ce2f3fc0d86a1b66a610c9278ce9cf0e75b600
6
+ metadata.gz: d8a92d42e7b7f79761f5ad4efec357071bf5f844797883139e248177a059f9b108d62080f7d45db5e3ffbbcbf7aee4383621462bcd6e14f75ffffcffcf0ff145
7
+ data.tar.gz: e2315412cb5e63b24d5d554dfddfa69e99895ba7c30ee015d829eadfd6908e36d976cb6cb5e4151afbc7adf75ce7b54653e43e8d5c7a109796cf51364912ae87
@@ -127,9 +127,12 @@ module Effective
127
127
  else
128
128
  if values.all? { |v| v.kind_of?(ActiveRecord::Base) && v.respond_to?(name) }
129
129
  values = values.map { |v| (v[name] if opts[:sql_as_column]) || v.public_send(name) }
130
+ format_column(aggregate_column(values, opts, aggregate), opts)
131
+ elsif values.all? { |v| (v == true || v == false) }
132
+ aggregate_column(values, opts, aggregate)
133
+ else
134
+ format_column(aggregate_column(values, opts, aggregate), opts)
130
135
  end
131
-
132
- format_column(aggregate_column(values, opts, aggregate), opts)
133
136
  end || BLANK
134
137
  end.compact
135
138
  end
@@ -142,20 +142,24 @@ module Effective
142
142
  when :time
143
143
  value.respond_to?(:strftime) ? value.strftime(EffectiveDatatables.format_time) : BLANK
144
144
  when :text
145
+ value_to_s = value.to_s
146
+
145
147
  if csv
146
- value
147
- elsif value.to_s.starts_with?('<') && value.to_s.ends_with?('>')
148
- view.sanitize(value.to_s)
148
+ value_to_s
149
+ elsif value_to_s.include?('<') && value_to_s.include?('>')
150
+ view.sanitize(value_to_s)
149
151
  else
150
- view.simple_format(value.to_s)
152
+ view.simple_format(value_to_s)
151
153
  end
152
154
  when :string
155
+ value_to_s = value.to_s
156
+
153
157
  if csv
154
- value
155
- elsif value.to_s.starts_with?('<') && value.to_s.ends_with?('>')
156
- view.sanitize(value.to_s)
158
+ value_to_s
159
+ elsif value_to_s.include?('<') && value_to_s.include?('>')
160
+ view.sanitize(value_to_s)
157
161
  else
158
- view.escape_once(value.to_s)
162
+ view.escape_once(value_to_s)
159
163
  end
160
164
  else
161
165
  value.to_s
@@ -1,3 +1,3 @@
1
1
  module EffectiveDatatables
2
- VERSION = '4.20.1'.freeze
2
+ VERSION = '4.20.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.20.1
4
+ version: 4.20.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: 2023-10-25 00:00:00.000000000 Z
11
+ date: 2023-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails