gauze 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/gauze/base.rb +9 -1
- data/lib/gauze/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 225d09f51569d3affeafc03f6ed31329d2f62eab
|
|
4
|
+
data.tar.gz: 071d007dcc6f90649a0fb021e4a8a30c618f6db6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3c7f20a66409dfed9f8b7104a94dd91a9eeee352d351ab0754f846ad992097a68b642eae5c61257348569ff8a5c32fdd091af212af49c00fe588ecdb468ebf5c
|
|
7
|
+
data.tar.gz: 0595b67cec62a0e1b10218947815700d2866d71cba8f1879a120ed5339b45891946e94ed251ed8ea4205cdd97dd8e171b3d405a909d134e91bf33e764f26ccd1
|
data/lib/gauze/base.rb
CHANGED
|
@@ -79,7 +79,15 @@ module Gauze
|
|
|
79
79
|
_arel_column = @resource.arel_table[sort_column[:column]]
|
|
80
80
|
end
|
|
81
81
|
|
|
82
|
-
|
|
82
|
+
#Apple the column with the sort direction
|
|
83
|
+
query = query.order(_arel_column.method(sort_direction).call)
|
|
84
|
+
|
|
85
|
+
if query.group_values.length > 0
|
|
86
|
+
query = query.group(_arel_column)
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
return query
|
|
83
91
|
end
|
|
84
92
|
|
|
85
93
|
private
|
data/lib/gauze/version.rb
CHANGED