effective_datatables 4.8.7 → 4.8.8

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: 07af3389758253f35f041e4940c0467b8b14d53ffc2b58ac18abc2f1fb8692fd
4
- data.tar.gz: c6c267724e600494f877428da6cf1e5351b7801c1c734febfd662103126963a8
3
+ metadata.gz: a9523ed0159096daf782db8331cd502b8b705667a9b6bce9b22e5e46a167cfed
4
+ data.tar.gz: 8e118dcc38bbfd2f2bbb47e2e24cbb76a12159e97060636c0625f714b7d8badf
5
5
  SHA512:
6
- metadata.gz: 50831bd5f7daaa5eb28ea8ae0bf2ab92dd757e8f701b65a646319da0e0c7d510997ba138654eecffba229851b1ed621b359e9e671343e58ee00ce8337a7ecc5b
7
- data.tar.gz: 43c879891027da79facfae68dc5f0cba2b7233026977dff59856cf014026566748319afc93df2e4bf7a41f797d14f852af4b1e0d1a2aaca752877cf7cf0e5e7b
6
+ metadata.gz: 75f57a4bd505a0c21f121c506dc3dad7f757af1a94e3e3677dfd5a941e6e1650411eacfd774d45ebe2e6c94e8cc67f47eabe89f4644824aa154cf05126e7621c
7
+ data.tar.gz: abdc9f48a7694c17313fc4a10f50987c8ecbd56e8796d1651c633c82b788ddcf94c06205797a7204fcbd49a00fb4f68bc99b6ed2884feb99d74b8a3a2d228e6e
@@ -16,7 +16,7 @@ module Effective
16
16
  next unless state[:visible][name]
17
17
 
18
18
  if opts[:partial]
19
- locals = { datatable: self, column: opts }.merge(resource_col_locals(opts))
19
+ locals = { datatable: self, column: opts }.merge!(resource_col_locals(opts))
20
20
 
21
21
  rendered[name] = (view.render(
22
22
  partial: opts[:partial],
@@ -27,7 +27,6 @@ module Effective
27
27
  spacer_template: SPACER_TEMPLATE
28
28
  ) || '').split(SPACER)
29
29
  elsif opts[:as] == :actions # This is actions_col and actions_col do .. end, but not actions_col partial: 'something'
30
- resources = collection.map { |row| row[opts[:index]] }
31
30
  locals = { datatable: self, column: opts, spacer_template: SPACER_TEMPLATE }
32
31
 
33
32
  atts = {
@@ -36,16 +35,17 @@ module Effective
36
35
  effective_resource: effective_resource,
37
36
  locals: locals,
38
37
  partial: opts[:actions_partial],
39
- }.compact.merge(opts[:actions])
38
+ }.merge!(opts[:actions]).tap(&:compact!)
40
39
 
41
40
  rendered[name] = if effective_resource.blank?
42
- resources.map do |resource|
41
+ collection.map { |row| row[opts[:index]] }.map do |resource|
43
42
  polymorphic_resource = Effective::Resource.new(resource, namespace: controller_namespace)
44
43
  (view.render_resource_actions(resource, atts.merge(effective_resource: polymorphic_resource), &opts[:format]) || '')
45
44
  end
46
45
  else
47
- (view.render_resource_actions(resources, atts, &opts[:format]) || '').split(SPACER)
46
+ (view.render_resource_actions(collection.map { |row| row[opts[:index]] }, atts, &opts[:format]) || '').split(SPACER)
48
47
  end
48
+
49
49
  end
50
50
  end
51
51
 
@@ -135,7 +135,7 @@ module Effective
135
135
  end
136
136
 
137
137
  # Merge local options. Special behaviour for remote: false
138
- if column[:actions].kind_of?(Hash) && column[:actions].present?
138
+ if column[:actions].present? && column[:actions].kind_of?(Hash)
139
139
  column[:actions].each do |action, opts|
140
140
  next unless opts.kind_of?(Hash)
141
141
 
@@ -1,3 +1,3 @@
1
1
  module EffectiveDatatables
2
- VERSION = '4.8.7'.freeze
2
+ VERSION = '4.8.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.8.7
4
+ version: 4.8.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: 2020-09-08 00:00:00.000000000 Z
11
+ date: 2020-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -193,7 +193,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
193
193
  - !ruby/object:Gem::Version
194
194
  version: '0'
195
195
  requirements: []
196
- rubygems_version: 3.1.2
196
+ rubygems_version: 3.1.4
197
197
  signing_key:
198
198
  specification_version: 4
199
199
  summary: Uniquely powerful server-side searching, sorting and filtering of any ActiveRecord