effective_datatables 4.10.2 → 4.10.5

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: b43481421038a1511a8c6ccca052678aa5f70d8c70465e1e267d43fe4f05aa0f
4
- data.tar.gz: d598bcb2c9633ab6dabaf7d2fe1cc7078dae9065613022437b200e43d06b1d1a
3
+ metadata.gz: ff2fc2d1c01b95734ac79fc727db5683a484399a5e68b370c1c80665310b2758
4
+ data.tar.gz: 4c1a8848ab3a22590c902388814ce9faec463adfa032e68d0144568282788d54
5
5
  SHA512:
6
- metadata.gz: 5447d312f17607bb74eb955083085df297beeee2b92bb60ded0271f025a7095b5bae36a473ab79b456efc54cff8787bda574ca1b0c35276228155941023d7fe0
7
- data.tar.gz: bd9c7bd9543d56529dc444b1f753087195a8ee6bc7631e07490a6b2d6115624b3c5f8fc2b7fe3dd832e627a7dd9e454be3a9471a0ebaf2cdd289f79abd149521
6
+ metadata.gz: 9001e7fe0a63a75445f35a9a36046a40a067f31c57e424ac0ac5c76a83662b762238e9a3e15b45b6ac893af369a97d2f3b3becaac01ff8b93fb3ccdeff94c29c
7
+ data.tar.gz: 8a4be22def5f90615598d06a0a89b578bb088be5b61beb2b65267466070b80fe3490e40821755158857357abf4faff15a45ea4957bda17ba5316489b10397eb1
@@ -62,6 +62,7 @@ module EffectiveDatatablesHelper
62
62
  'inline' => inline.to_s,
63
63
  'language' => EffectiveDatatables.language(I18n.locale),
64
64
  'options' => input_js.to_json,
65
+ 'reorder' => datatable.reorder?.to_s,
65
66
  'reorder-index' => (datatable.columns[:_reorder][:index] if datatable.reorder?).to_s,
66
67
  'simple' => simple.to_s,
67
68
  'spinner' => icon('spinner'), # effective_bootstrap
@@ -176,6 +176,8 @@ module Effective
176
176
 
177
177
  if column[:format]
178
178
  datatable.dsl_tool.instance_exec(obj, row, &column[:format])
179
+ elsif column[:as] == :belongs_to_polymorphic
180
+ obj.send(column[:name]).to_s
179
181
  elsif column[:partial]
180
182
  obj.to_s
181
183
  elsif obj.respond_to?(column[:name])
@@ -95,6 +95,14 @@ module Effective
95
95
  return value if value.kind_of?(String)
96
96
  end
97
97
 
98
+ if value.kind_of?(Array) && column[:as] == :string
99
+ if csv
100
+ return value.map { |v| format_column(v, column, csv: csv) }.join("\n")
101
+ else
102
+ return value.map { |v| view.content_tag(:div, format_column(v, column, csv: csv), class: 'col-resource_item') }.join.html_safe
103
+ end
104
+ end
105
+
98
106
  case column[:as]
99
107
  when :actions
100
108
  raise("please use actions_col instead of col(#{name}, as: :actions)")
@@ -115,7 +123,7 @@ module Effective
115
123
  when :duration
116
124
  view.number_to_duration(value)
117
125
  when :effective_addresses
118
- value.to_html
126
+ csv ? value.to_html.gsub('<br>', "\n") : value.to_html
119
127
  when :effective_obfuscation
120
128
  value
121
129
  when :effective_roles
@@ -1,3 +1,3 @@
1
1
  module EffectiveDatatables
2
- VERSION = '4.10.2'.freeze
2
+ VERSION = '4.10.5'.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.10.2
4
+ version: 4.10.5
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: 2021-12-20 00:00:00.000000000 Z
11
+ date: 2022-02-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails