simpleadmin 1.0.2 → 1.0.3
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: 5475a7e55a4a8672e7524500c27e92399dab2440
|
4
|
+
data.tar.gz: 168b7ac2be2630a294ca30cd5cf32922ccd554a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed8202a0810a0bf7957d4abda2a3cb63b76a5725dca2124ce9f1919eb8eecc31d86b737e4496ef3c7d5fd809c293fbfffdafe88cef5b04bc892309d613478f8e
|
7
|
+
data.tar.gz: 5b7e63c249a5ed08c29e66af599cbcee9de17e71a8c49eade317f6def70aa964c0856bbb9b90da72a18fe1aa5de25ddc4902c2400c514e846ad333ec03c19f6c
|
@@ -8,7 +8,7 @@ module SimpleAdmin
|
|
8
8
|
page = params[:page].to_i if params[:page].present?
|
9
9
|
total = model_klass.count
|
10
10
|
|
11
|
-
resources = model_klass.
|
11
|
+
resources = model_klass.limit(per_page)
|
12
12
|
|
13
13
|
if params[:query].present?
|
14
14
|
search_result = search(params[:query], model_klass, params[:model_attributes])
|
@@ -18,7 +18,12 @@ module SimpleAdmin
|
|
18
18
|
end
|
19
19
|
|
20
20
|
resources = resources.offset((per_page * page) - per_page) if page.present?
|
21
|
-
|
21
|
+
|
22
|
+
if params[:sort].present?
|
23
|
+
resources = resources.order(params[:sort][:column_name] => params[:sort][:order])
|
24
|
+
else
|
25
|
+
resources = resources.order(id: :asc)
|
26
|
+
end
|
22
27
|
|
23
28
|
resources = resources.map do |resource|
|
24
29
|
_resource = {}
|
data/lib/simpleadmin/version.rb
CHANGED