effective_datatables 4.25.3 → 4.26.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: 6795fc15046e40e435529576eb9f7f4c3473e51c12f0a62778854d567b8abee6
4
- data.tar.gz: a1db0bc8b76f4f47561458dc7df631ed065cb5f5734840db664b493cb2012cbe
3
+ metadata.gz: e6af5d5e2542f1b4b587ad472f4be837fe81cf57cad38edf272986ba358710ae
4
+ data.tar.gz: ada5f3e65dd9c40eedf6acda70db0e5955dc0b693fb1604392a1fbd5e7e98bba
5
5
  SHA512:
6
- metadata.gz: 16816ddfd74f48e8d6deb1ac9a2d05d665fc8c063e8865b7c7237df8cc5a1b70921472927a26d09f00e94fb65764ab3280373c857ffa7c9ebe8e6d33d9b18d54
7
- data.tar.gz: 4b65d03eddc9bc7bf6040b069995b211747cabcfdf0ca5bff05c9337172cfd59926a7f7bcbbb3b92fb3bb27bab85775e0838a78799ff265020eb84397fe0449c
6
+ metadata.gz: 6833350b97bb37061602f756c291b7fb30af237b0895952f6ac41ac4e4b565e03d7ce1ab5503e1ef4adc2fca3574edb325b81d5d3a9818515be2b039f3d580f0
7
+ data.tar.gz: '0859ffbe2c11c23c58d2743d76bd99f23af3c67d28f3b888ab3ecd9f68e0a9b9c181b37ad7e93b406e7bde949c04566dd4b7d0bf7b1a183cb6fb0df7e13dbb22'
@@ -23,6 +23,10 @@ module Effective
23
23
  @attributes[:format] = block; self
24
24
  end
25
25
 
26
+ def format_each(&block)
27
+ @attributes[:format_each] = block; self
28
+ end
29
+
26
30
  def search(&block)
27
31
  @attributes[:search_method] = block; self
28
32
  end
@@ -134,7 +134,7 @@ module Effective
134
134
  when :effective_obfuscation
135
135
  value.to_s
136
136
  when :effective_roles
137
- value.join(', ')
137
+ csv ? value.join(', ') : view.roles_badges(value)
138
138
  when :email
139
139
  csv ? value : view.mail_to(value)
140
140
  when :integer
@@ -224,6 +224,7 @@ module Effective
224
224
  resource_name: resource_name,
225
225
  resource_to_s: resource_to_s,
226
226
  effective_resource: associated_resource,
227
+ format_each: opts[:format_each],
227
228
  show_action: false,
228
229
  edit_action: false
229
230
  }
@@ -1,5 +1,7 @@
1
1
  - Array(local_assigns[:resource_name] ? resource.public_send(resource_name) : resource).each do |resource|
2
- - resource_to_s = ((local_assigns[:resource_to_s] && resource) ? resource.public_send(resource_to_s) : resource.to_s)
2
+ - resource_to_s = (resource.public_send(resource_to_s) if local_assigns[:resource_to_s])
3
+ - resource_to_s ||= (instance_exec(resource, datatable, &format_each).html_safe if local_assigns[:format_each])
4
+ - resource_to_s ||= resource.to_s
3
5
 
4
6
  - if resource_to_s.present?
5
7
  .col-resource_item
@@ -1,3 +1,3 @@
1
1
  module EffectiveDatatables
2
- VERSION = '4.25.3'.freeze
2
+ VERSION = '4.26.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.25.3
4
+ version: 4.26.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: 2024-03-14 00:00:00.000000000 Z
11
+ date: 2024-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails