effective_datatables 2.1.5 → 2.1.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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: be50e832316ab6b4f88107a1154d7663f4c9ee37
|
4
|
+
data.tar.gz: 8e056de000c513e88fb81eb1c36e32bd7e59fdfc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 93f84a969b61dec2417dc810d8f777c76457f5b350e1192e6ab3bc0d0082d361c275275a3f56fc8d5ba2320ed1c16d91f9745ba4a66a9952fef433a4f5131839
|
7
|
+
data.tar.gz: 6c1076d1f1dea6356589a1f51bc095d9393acaed072cd3b0c4fa8b0eceb0a97324b2eaeb046e74a9c01f4be024d980f6169b9cd0bfda63dc9bb3e304808a0a9a
|
@@ -20,10 +20,14 @@ module Effective
|
|
20
20
|
def order(collection)
|
21
21
|
return collection if order_column.blank?
|
22
22
|
|
23
|
+
column = order_column[:column]
|
24
|
+
|
23
25
|
if [:string, :text].include?(order_column[:type]) && order_column[:sql_as_column] != true
|
24
|
-
collection.order("COALESCE(#{
|
26
|
+
collection.order("COALESCE(#{column}, '') #{order_direction}")
|
27
|
+
elsif order_column[:type] == :belongs_to_polymorphic
|
28
|
+
collection.order("(#{column.sub('_id"', '_type"')}, #{column}) #{order_direction} NULLS LAST")
|
25
29
|
else
|
26
|
-
collection.order("#{
|
30
|
+
collection.order("#{column} #{order_direction} NULLS LAST")
|
27
31
|
end
|
28
32
|
end
|
29
33
|
|
@@ -73,8 +73,8 @@ module Effective
|
|
73
73
|
|
74
74
|
cols[name][:class] = "col-#{cols[name][:type]} col-#{name} #{cols[name][:class]}".strip
|
75
75
|
|
76
|
-
# We can't
|
77
|
-
if cols[name][:type] == :has_many
|
76
|
+
# We can't really sort a HasMany field
|
77
|
+
if cols[name][:type] == :has_many
|
78
78
|
cols[name][:sortable] = false
|
79
79
|
end
|
80
80
|
|