slash_admin 1.0.3 → 1.0.4
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: 5f5bde9d4de6fa2c39197e090dee5bc7c4cca1bba1081dd3ddb6242af111b253
|
4
|
+
data.tar.gz: 8b1ef63565ec37d1381df9d0cb51649238414e5e8a249e0bf99fd5ffd11bb319
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c93495b0258ecd29303cfc99fc19e66f90cfdedda691c5cd318da5abe4f400954d955eb4c75f8e95fa0c81ade83022e07e8c53da119bb067b13807ab77c166d6
|
7
|
+
data.tar.gz: 23cb10977a3093ca81ab46ca6e7e376d336c93e90471eaf78a8ef922a49f660db26efb89fec1845443dd33317621f4a7bc766e15215f349cc2daad5a3e508b64
|
@@ -22,7 +22,8 @@ module SlashAdmin
|
|
22
22
|
column = @model_class.arel_table[params[:order_field].to_sym]
|
23
23
|
order = params[:order].downcase
|
24
24
|
if %w[asc desc].include?(order)
|
25
|
-
|
25
|
+
attributes = @model_class.new.attributes.keys
|
26
|
+
if (!attributes.include?(params[:order_field]) && @model_class.method_defined?(params[:order_field])) || @models_export.is_a?(Array)
|
26
27
|
@models = if order == "asc"
|
27
28
|
@models_export.sort { |m1, m2| m1.send(params[:order_field]) <=> m2.send(params[:order_field]) }
|
28
29
|
else
|
@@ -296,7 +297,7 @@ module SlashAdmin
|
|
296
297
|
params[:filters].each do |attr, query|
|
297
298
|
unless query.blank?
|
298
299
|
if virtual_fields.present? && virtual_fields.include?(attr.to_s)
|
299
|
-
search = search.select { |s| s.send(attr).present? ? s.send(attr).downcase.include?(query.downcase) : nil }
|
300
|
+
search = search.select { |s| s.send(attr).present? ? s.send(attr).to_s.downcase.include?(query.downcase) : nil }
|
300
301
|
end
|
301
302
|
end
|
302
303
|
end
|
data/lib/slash_admin/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slash_admin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- KOVACS Nicolas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-11-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|