effective_datatables 3.7.3 → 3.7.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ffda731c223c88524c9b86916f9a699cd23a388538b18a9687229a054bdb8ec9
|
4
|
+
data.tar.gz: 7580eb3b4b06a7d36b5ba2ddfa92d159c9cb42d5a5240cc811453d037a12d3dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d07acd93b0557e28e24363ec4d68bd46d6c19f67544acfa8e66dcccadc5e4510199cfc2be3a9f89f1ddbadcd537518983f2a6b08994733ec83997e10ba1b524
|
7
|
+
data.tar.gz: a71389bfb336ecf7e7030383061438895c4af0f14f55d6f89f6bc8182adab7580d42e65fa319ea730f7262c8812fae4cc2ec954886c2769def6348d3d95ad8fc
|
@@ -48,8 +48,8 @@ module EffectiveDatatablesPrivateHelper
|
|
48
48
|
action = action.merge(column[:actions][:new])
|
49
49
|
|
50
50
|
effective_resource = (datatable.effective_resource || datatable.fallback_effective_resource)
|
51
|
-
klass = (column[:actions][:new][:klass] || effective_resource
|
52
|
-
elsif Array(datatable.effective_resource
|
51
|
+
klass = (column[:actions][:new][:klass] || effective_resource.try(:klass) || datatable.collection_class)
|
52
|
+
elsif Array(datatable.effective_resource.try(:actions)).include?(:new)
|
53
53
|
effective_resource = datatable.effective_resource
|
54
54
|
klass = effective_resource.klass
|
55
55
|
else
|
@@ -126,7 +126,7 @@ module Effective
|
|
126
126
|
# Applies data-remote to anything that's data-method post or delete
|
127
127
|
# Merges in any extra attributes when passed as a Hash
|
128
128
|
def actions_col_actions(column)
|
129
|
-
resource_actions = (effective_resource
|
129
|
+
resource_actions = (effective_resource.try(:resource_actions) || fallback_effective_resource.fallback_resource_actions)
|
130
130
|
|
131
131
|
actions = if column[:inline]
|
132
132
|
resource_actions.transform_values { |opts| opts['data-remote'] = true; opts }
|
@@ -139,7 +139,7 @@ module Effective
|
|
139
139
|
column[:actions].each do |action, opts|
|
140
140
|
next unless opts.kind_of?(Hash)
|
141
141
|
|
142
|
-
existing = actions.find { |_, v| v[:action] == action }
|
142
|
+
existing = actions.find { |_, v| v[:action] == action }.try(:first)
|
143
143
|
next unless existing.present?
|
144
144
|
|
145
145
|
actions[existing]['data-remote'] = opts[:remote] if opts.key?(:remote)
|
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: 3.7.
|
4
|
+
version: 3.7.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: 2019-
|
11
|
+
date: 2019-12-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|