effective_datatables 4.20.4 → 4.20.6

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: de9e67c1d5ddd3f19c322ea61f2bb1b50f9792e1ca6666607af4a14f11dc615d
4
- data.tar.gz: ae1f07be260e375e21d4cf4520a1d55fb4c51787ea09f4f56acfc49168137f45
3
+ metadata.gz: 6f7c205135a1636a8e73e9b18f9a1ae773a742dedaf1f8c9ded5841437b76de1
4
+ data.tar.gz: 4833cbbf89c6c11c58e3493df4c6ce9cd6832eab94fe57c82a9cd4b7bb1e063e
5
5
  SHA512:
6
- metadata.gz: 711ca1ee0f32fd3b91bcac59f294ac8d3822d364a7318ee89d68ed6a8d0de7147dab2934365abcc3e49ba1ea85142ba50f515207601e651677fc74f1cfdf5281
7
- data.tar.gz: fd4a8536658314a46199c03aec85898365b992472b78e7e8592b468a25f6cc16ed914b2385f131b0e5f927963b5990a469b0a93e8e62697ec80c151e611ca7ba
6
+ metadata.gz: 3369c5d02656e568ad03d80f063c862deb76fbdbe7ee59f3825b7648be9c65903c63f7185e0318aa81265fc723e4b14d704b838c1e7ec37b0692ff0daa4c258a
7
+ data.tar.gz: f4bedb87ab51be6fcaf49392e65ccabfabf3c1b15df3d88338015ea2aa40704167c03caa45cee6c6bf162098351734373b946c21f5f72e37e9105b0f34a14981
@@ -28,8 +28,8 @@ module Effective
28
28
  retval = attributes.except(*resources.keys)
29
29
 
30
30
  resources.each do |k, resource|
31
- retval["#{k}_id".to_sym] = resource.id
32
31
  retval["#{k}_type".to_sym] = resource.class.name
32
+ retval["#{k}_id".to_sym] = resource.id
33
33
  end
34
34
 
35
35
  retval
@@ -177,7 +177,9 @@ module Effective
177
177
  search = opts[:search]
178
178
 
179
179
  # Parameterize collection
180
- if search[:collection].kind_of?(ActiveRecord::Relation)
180
+ if attributes[:searchable] == false
181
+ # Nothing to do
182
+ elsif search[:collection].kind_of?(ActiveRecord::Relation)
181
183
  search[:collection] = search[:collection].map { |obj| [obj.to_s, obj.id] }
182
184
  elsif search[:collection].kind_of?(Array) && search[:collection].first.kind_of?(ActiveRecord::Base)
183
185
  search[:collection] = search[:collection].map { |obj| [obj.to_s, obj.id] }
@@ -193,7 +195,9 @@ module Effective
193
195
  search_resource = search_resource.find { |res| res.klass.present? } || search_resource.first
194
196
 
195
197
  # Assign search collections from effective_resources
196
- if search[:as] == :string
198
+ if attributes[:searchable] == false
199
+ # Nothing to do
200
+ elsif search[:as] == :string
197
201
  # Nothing to do. We're just a string search.
198
202
  elsif search[:as] == :select && search[:collection].kind_of?(Array)
199
203
  # Nothing to do. We already loaded the custom parameterized collection above.
@@ -1,3 +1,3 @@
1
1
  module EffectiveDatatables
2
- VERSION = '4.20.4'.freeze
2
+ VERSION = '4.20.6'.freeze
3
3
  end
@@ -80,12 +80,13 @@ module EffectiveDatatables
80
80
 
81
81
  raise 'invalid decoded inline payload' unless attributes.kind_of?(Hash)
82
82
 
83
- attributes
83
+ attributes.symbolize_keys
84
84
  end
85
85
 
86
86
  def self.message_encrypter
87
- key = (Rails.application.secrets.secret_key_base.presence rescue nil)
88
- key ||= (Rails.application.secret_key_base.presence rescue nil)
87
+ key = (Rails.application.secret_key_base.presence rescue nil)
88
+ key ||= (Rails.application.try(:credentials).try(:secret_key_base).presence rescue nil)
89
+ key ||= (Rails.application.try(:secrets).try(:secret_key_base).presence rescue nil)
89
90
  key ||= 10.times.map { "".hash.to_s }.join
90
91
 
91
92
  ActiveSupport::MessageEncryptor.new(key.to_s.first(32))
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.20.4
4
+ version: 4.20.6
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: 2023-11-15 00:00:00.000000000 Z
11
+ date: 2023-11-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails