effective_datatables 3.7.3 → 3.7.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: 10c87c87d54529b6e4952b9abc58512f1ab9c2dc3e9f6d6e03c5ed141a388dd3
4
- data.tar.gz: c2a7fd23d6f7790e6e083af1084e61f969793fe587ed9722811e6197a4516465
3
+ metadata.gz: ffda731c223c88524c9b86916f9a699cd23a388538b18a9687229a054bdb8ec9
4
+ data.tar.gz: 7580eb3b4b06a7d36b5ba2ddfa92d159c9cb42d5a5240cc811453d037a12d3dc
5
5
  SHA512:
6
- metadata.gz: 3bb3d7ab4f1ed0642f972bfdfd0828333b5149af4dc474fa1d9ecedb5a009ef20cd3ea2b29ab4bb71e8c7e85c7236edd4a22cce63503383acab3e40a25644407
7
- data.tar.gz: 76b83708cb8b0d2cdd6f67c608a9892d473be9d0f58b29438c1d445015aedc3b2b345b027811cbb4957b1154d9a057e3ed8151bb28ae8dc7f7ad9066341c31a1
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&.klass || datatable.collection_class)
52
- elsif Array(datatable.effective_resource&.actions).include?(:new)
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&.resource_actions || fallback_effective_resource.fallback_resource_actions)
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 }&.first
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)
@@ -1,3 +1,3 @@
1
1
  module EffectiveDatatables
2
- VERSION = '3.7.3'.freeze
2
+ VERSION = '3.7.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: 3.7.3
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-10-17 00:00:00.000000000 Z
11
+ date: 2019-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails