forest_admin_datasource_active_record 1.0.0.pre.beta.44 → 1.0.0.pre.beta.46
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: 07a8bdd2af59c3debde1fb639ed93c2542f62b7e73dcb8ad5569a68754a21ee7
|
4
|
+
data.tar.gz: 22a913eb8b04ff9304f4b60c56c41df3b2128d8481c195d4f05c3445009bfb61
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2b8af0ebb35899c9035fe42bb808aa1183098dde0a43751628a0c05c169384643065c084b4d2ca6c7b7699fece8b3861b2eafd76bfb681e8db70b7ac1a37ba80
|
7
|
+
data.tar.gz: f1c7d6d3c100fcdeff9bd7a581da5965700504a4431388fb77f7b9325058df9461513023f8d67b3e97ed99cb984dcfd8c1ab66aebdb6a99292b19f47160379cb
|
@@ -21,6 +21,16 @@ module ForestAdminDatasourceActiveRecord
|
|
21
21
|
def apply_filter
|
22
22
|
@query = apply_condition_tree(@filter.condition_tree) unless @filter.condition_tree.nil?
|
23
23
|
@query = apply_pagination(@filter.page) unless @filter.page.nil?
|
24
|
+
@query = apply_sort(@filter.sort) unless @filter.sort.nil?
|
25
|
+
|
26
|
+
@query
|
27
|
+
end
|
28
|
+
|
29
|
+
def apply_sort(sort)
|
30
|
+
sort.each do |sort_clause|
|
31
|
+
field = format_field(sort_clause[:field])
|
32
|
+
@query = @query.order(field => sort_clause[:ascending] ? :asc : :desc)
|
33
|
+
end
|
24
34
|
|
25
35
|
@query
|
26
36
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: forest_admin_datasource_active_record
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.pre.beta.
|
4
|
+
version: 1.0.0.pre.beta.46
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthieu
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-05-
|
12
|
+
date: 2024-05-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|