effective_datatables 4.7.6 → 4.7.7
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee156f06d9f35299e3e4cba5f45fa4525e2d74272d3e937061b13509b972d77e
|
4
|
+
data.tar.gz: 98ee4e7f35efd7fe6132ab3cbee74cff4f8bfc302a52c2b2b6494515839f215e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5233cce6528fca4f2a67852861b60c3618c4ca02d6e3f4f7317360719642e242e1d4345b7cfa29aaeb46dcdc2a05c9d00d38b363c9c2b12bcbe0435d1dac3cf3
|
7
|
+
data.tar.gz: d24aae4ceab7c2f86200b9a160920cad475017bba99289139b4f6ffd230f1a3f3c0da988fafd74055179b2f6ee517bb978ae8aa7d963e152c08c1603dfdb6e47
|
@@ -164,28 +164,16 @@ module Effective
|
|
164
164
|
|
165
165
|
search = opts[:search]
|
166
166
|
|
167
|
-
if search[:collection].kind_of?(ActiveRecord::Relation)
|
168
|
-
search[:collection] = search[:collection].map { |obj| [obj.to_s, obj.to_param] }
|
169
|
-
elsif search[:collection].kind_of?(Array) && search[:collection].first.kind_of?(ActiveRecord::Base)
|
170
|
-
search[:collection] = search[:collection].map { |obj| [obj.to_s, obj.to_param] }
|
171
|
-
elsif search[:collection].kind_of?(Array)
|
172
|
-
search[:collection].each { |obj| obj[1] = 'nil' if obj[1] == nil }
|
173
|
-
elsif search[:collection].kind_of?(Hash)
|
174
|
-
search[:collection].each { |k, v| search[:collection][k] = 'nil' if v == nil }
|
175
|
-
end
|
176
|
-
|
177
|
-
search[:value] ||= search.delete(:selected) if search.key?(:selected)
|
178
|
-
|
179
167
|
search[:as] ||= :select if search.key?(:collection)
|
168
|
+
search[:fuzzy] ||= true unless search.key?(:fuzzy)
|
169
|
+
search[:value] ||= search.delete(:selected) if search.key?(:selected)
|
180
170
|
|
181
|
-
|
171
|
+
# Merge with defaults
|
172
|
+
search_resource = (opts[:resource] || effective_resource || fallback_effective_resource)
|
182
173
|
|
183
|
-
if
|
184
|
-
|
185
|
-
elsif array_collection? && opts[:resource].present?
|
186
|
-
search.reverse_merge!(opts[:resource].search_form_field(name, collection.first[opts[:index]]))
|
174
|
+
if array_collection? && opts[:resource].present?
|
175
|
+
search.reverse_merge!(search_resource.search_form_field(name, collection.first[opts[:index]]))
|
187
176
|
elsif search[:as] != :string
|
188
|
-
search_resource = (opts[:resource] || effective_resource || fallback_effective_resource)
|
189
177
|
search.reverse_merge!(search_resource.search_form_field(name, opts[:as]))
|
190
178
|
end
|
191
179
|
|
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.7.
|
4
|
+
version: 4.7.7
|
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-07-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|